Split VCL and View on MVP


2005-07-03 06:51:55 AM
delphi5
Us, of the Infra team, are not adepts of the inheritance of the vcl for
Views and we began to create a hierarchy of VCLViews no inherited of
VCL. Something as Decorators for VCL. The idea is to have a Hierarchy
for VCL, other for IntraWeb, etc...
We have been creating a class VCLControlView to manipulate the events of
TControl and a class VCLWinControlView to handle the events of
TWinControl. VCLWinControlView inherits of VCLControlView as it happens
in VCL.
VCLControlView implements the method AttachControl(Control: TControl) of
IView's interface and it is in this method that we reviewed the events
for methods in the class.
When an event happens in VCL one of the handler methods of
VCLControlView or one of their descendants is called and this trigger
the publication of an objectevent that will be diffuse for observers
that have interest in this type of objectevent.
This is an attempt of not needing to install new visual components in
IDE's delphi but to have the possibility to use MVP. We didn't create
Interactors, because we believed that can make the things just
manipulating the events of the controls, and would like to know your
opinion about this design.
Would we also like anybody to tell us which to real need of the interactors?