Motivation of interfaces
Posted: Tue May 28, 2013 8:30 pm
With AmigaOS 4 we got libraries with interfaces. What was the motivation behind adding this extra layer?
I think it is nice to be able to f.i. like in exec.library have a debug interface, but most of the time as a developer using a library, it only adds two extra GetIface/DropIface calls, together with a interface pointer to keep track of, besides the library pointer. Furthermore, not only do I need to keep track of the library's name, but also know if it has a "main" interface or if this particular library calls it something else.
Besides the debug interface of exec, I've yet to find any real usage of it. The application.library has two interfaces: "application" and "prefsobject", but I don't see the real advantage here.
I think it is nice to be able to f.i. like in exec.library have a debug interface, but most of the time as a developer using a library, it only adds two extra GetIface/DropIface calls, together with a interface pointer to keep track of, besides the library pointer. Furthermore, not only do I need to keep track of the library's name, but also know if it has a "main" interface or if this particular library calls it something else.
Besides the debug interface of exec, I've yet to find any real usage of it. The application.library has two interfaces: "application" and "prefsobject", but I don't see the real advantage here.