Motivation:
While you design a inheritance hierarchy to handle different type of things like
Network devices.
and you find slowly that each NE, has some common behaviour and also some different behaviour.
you also find that, for some types of NE, you are required to provide empty implementation.
you find that , with new requirements you are forced to touch the methods/behaviour of existing code.
then you need to do following
1. separate interfaces for different types
2. as much as possible create more types of behavioural implementation,
like rebbotable device, repluggabe, nonStoppable, manually Stoppable, autoStoppable, reconfiguration, autoReconfigurable, manualReconfigurable, Updatable,timeUpdatable, versionUpdatable.
3. and then composition this behaviour(object) inside your Network element object.
like OME(with autoupgradable).
so when u create that OME type of NE, you also create autoupgradable object ( behaviour ) and pass to constructor.
so you encapsulate the behaviour .
PROGRAM TO SUPER TYPE
that means , you have a placeholder for plugganle/stoppable etc types of super type interfaces insidr NE class,
and later at runtime you can create and subtype object and assign.
No comments:
Post a Comment