Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling order of instantiation
Message
 
To
31/07/1997 07:19:45
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00042294
Message ID:
00042891
Views:
35
>Jim,
>
>You are confusing me somewhat on this issue. . .
>
>In one instance you decry the idea of having one object dependent on the instantiation/firing order, and on the other hand you speak of design patterns with mediators and delegation.

Jim,

The destinction is as to whether the point upon which your design is dependent is under your control or ooutside of your control. With a dependency on instantiation sequence you do not have full control. Other objects can be added or objects may be removed and that will alter the instantiation sequence. These changes could be done by you or by someone else.

Interdependency between objects is a situation that should be avoided, but it cannot be completely non-existant otherwise nothing would ever happen in the application because no object would ever send a message to another object (which in itself is a dependency). The reasons to avoid a dependency on instantiation sequence are;

1) it is not under your complete control

2) it renderns your design non portable to other OO language which may have a different instantiation sequence

3) the sequence is easily altered as a side effect of some other action (adding or removing controls)

The reasons a mediation pattern is more desireable are;

1) in the design of the mediator class you are aware of its interdependencies and can account for those issues

2) all dependent code is located in one place making it easier to fix any dependency related problems that may arise

3) the myriad of objects need to know about only one mediator object, the mediator object is the only object that needs any knowledge of all of the others
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform