Many applications in eGroupWare use an approach introduced by Ralf (I think)
to separate business logic from storage (persistence) and user interface.
This idea is good and basic knowledge of application design nowadays.
Nevertheless, this is not object orientated and not the MVC-Pattern:
Now we extend (or require in the constructor, which leads to the same result)
the UI from the BO from the SO and maybe even from so_sql.
But extending a class in object orientation means, that the concrete class
(UI) is a special case of the extended class (BO). Take an apple and a pear:
both are fruits:
class apple extends fruit
class pear extends fruit
In this case you would most possible even declare fruit to be an abstract
class, because there’s nothing concrete like a fruit, there are only bananas,
apples and so on: abstract class fruit.
Now the User interface is not a special case of the business object, but they
are two independent objects working together to solve a problem.
One but not the only evident problem with the wrong use of extend is, that you
instantiate classes, you probably don’t need: If the user sends you a form
with wrong data, you don’t need the storage object, but it’s still
instantiated.
It’s also not right to see THE userinterface and THE business object as one
object: Take the tracker: There are at least two well separated entities:
Trackers and Issues. So in an object oriented approach you would write a
class egwTracker and a class egwTrackerIssue like Nathan Gray does it with
invoices:
class invoice
class invoiceLine
class clientinvoice extends invoice
class supplierinvoice extends invoice
Regards, Thomas Koch
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers