Real OO interfaces in JADE
Posted: Fri Aug 07, 2009 10:48 am
by Chris Power >> Sun, 22 Apr 2001 20:35:28 GMT
Date: Saturday, 14 April 2001 1:52 p.m.
Resubmitted Monday 23 April 2001
I've been spending some long bus journeys commuting to work figuring out why and how Jade could use real object-oriented interfaces.
Why should Jade have interfaces? Well I am convinced that a schema hierarchy is not the best higher-level organising principle. It works moderately for some purposes and situations, but doesn't allow you to incorporate frameworks easily. Mostly these frameworks or subsystems require you to subclass classes in the framework, which is altogether too tight a form of coupling for re-use. Interfaces allow you to define a views of classes and hand out only interface references, which don't let you get at stuff you shouldn't know about. Interfaces can be implemented by classes anywhere in a class hierarchy, and this is the loose coupling required between subsystems. As an example, think of a class that you might want to simultaneously to have table-displayability and to have task-schedulability and half a dozen other things. It would simply implement the table-displayability interface and the task-schedulability interface, etc. without having to be a subclass of anything in particular.
I believe that some sort of package concept with interfaces would meet the need. Interfaces have been around OO circles for long enough and Java programmers and many C++ programmers have met them. There is support for them in Rational Rose.
How? Well, that's a long discussion I'd like to have, along with the "Why?" question, with anyone who's interested.
As a starting point for debate, I've whipped up a tiny proof-of-concept demo that shows interfaces - without the desirable changes to the development environment and language. The implementation of interfaces in this schema is very much manual, whereas it should use dialogs in the development system and hide the "implementation classes" I've had to use for mapping of method calls to methods of the implementator classes.
--
Chris Power
Email crpower@ihug.co.nz
Phone 64 (9) 818 1281
Date: Saturday, 14 April 2001 1:52 p.m.
Resubmitted Monday 23 April 2001
I've been spending some long bus journeys commuting to work figuring out why and how Jade could use real object-oriented interfaces.
Why should Jade have interfaces? Well I am convinced that a schema hierarchy is not the best higher-level organising principle. It works moderately for some purposes and situations, but doesn't allow you to incorporate frameworks easily. Mostly these frameworks or subsystems require you to subclass classes in the framework, which is altogether too tight a form of coupling for re-use. Interfaces allow you to define a views of classes and hand out only interface references, which don't let you get at stuff you shouldn't know about. Interfaces can be implemented by classes anywhere in a class hierarchy, and this is the loose coupling required between subsystems. As an example, think of a class that you might want to simultaneously to have table-displayability and to have task-schedulability and half a dozen other things. It would simply implement the table-displayability interface and the task-schedulability interface, etc. without having to be a subclass of anything in particular.
I believe that some sort of package concept with interfaces would meet the need. Interfaces have been around OO circles for long enough and Java programmers and many C++ programmers have met them. There is support for them in Rational Rose.
How? Well, that's a long discussion I'd like to have, along with the "Why?" question, with anyone who's interested.
As a starting point for debate, I've whipped up a tiny proof-of-concept demo that shows interfaces - without the desirable changes to the development environment and language. The implementation of interfaces in this schema is very much manual, whereas it should use dialogs in the development system and hide the "implementation classes" I've had to use for mapping of method calls to methods of the implementator classes.
--
Chris Power
Email crpower@ihug.co.nz
Phone 64 (9) 818 1281