23.07.2012 Views

Design Patterns Explained

Design Patterns Explained

Design Patterns Explained

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

54 Part II • The Limitations of Traditional Object-Oriented <strong>Design</strong><br />

CAD/CAM V1 is<br />

dearly not<br />

object-oriented<br />

CAD/CAM V2 is<br />

object-oriented<br />

This system is painful to deal with and clearly not object-oriented.<br />

Whoever is using the system must maintain the context for every<br />

query manually. Each call about a feature must know what kind of<br />

feature it has.<br />

The CAD/CAM vendor realized the inherent limitations of this type<br />

of system. The primary motivation for building V2 was to make it<br />

object-oriented. The geometry in V2 is therefore stored in objects.<br />

When a system requests a model, it gets back an object which represents<br />

the model. This model object contains a set of objects, each<br />

representing a feature. Since the problem domain is based on features,<br />

it is not surprising that the classes V2 uses to represent these features<br />

correspond exactly to the ones I have mentioned already: slots,<br />

holes, cutouts, specials, and irregulars.<br />

Therefore, in V2, I can get a set of objects that correspond to the<br />

features that exist in the sheet metal. The UML diagram in Figure 3-7<br />

shows the classes for the features.<br />

Figure 3-7 Feature classes of V2.<br />

The OOG stands for object-oriented geometry, just as a reminder<br />

that V2 is an object-oriented system.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!