Comparison with the Previous Solution

Compare this new solution, shown in Figure 12-11, with the earlier solution, which is shown again in Figure 12-12.

Figure 12-12. This was the first solution.


Another way to compare two solutions is to read them. In other words, the diagrams visually show inheritance (the is-a relationship) and composition (the has-a relationship). Read these diagrams using those words where the relationships are present.

In the original solution, I had a model that contains Features. Features are either slot features, hole features, cutout features, irregular features, or special features. Slot features are either V1 slots or V2 slots. V1 slots use the V1 system while the V2 slots use the OOGSlot. Hole features are either V1 hole features or V2 hole features. V1 hole features use the V1 system while the V2 hole features use the OOGHole. Getting tired of this already, aren't you?

Now read the latest solution. I have a model that contains Features. Features are either slot features, hole features, cutout features, irregular features, or special features. All features contain an implementation which is either a V1 implementation or a V2 implementation. V1 implementations use a V1 Facade to access the V1 system while V2 implementations adapt an OOGFeature. That's it. It sounds much better than just a portion of the other solution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset