29.11.2014 Views

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

20.3.1.8 Setting trade offs between competing resources<br />

In <strong>an</strong>y design there are various trade offs to be made. For example, the trade off between speed of<br />

access <strong><strong>an</strong>d</strong> data storage is a common one i n database systems. The larger the number of indexes used,<br />

the faster data retrieval c<strong>an</strong> be made (however the indexes must now be stored along with the data).<br />

Such design trade offs must be made with regard to the system as a whole (including non -software<br />

issues) as sub -optimal decision will be made if they are left for designers concentrating on a single<br />

package.<br />

20.3.2 <strong>Object</strong> design phase<br />

The object design essentially takes the models produced by the <strong>an</strong>alysis phase <strong><strong>an</strong>d</strong> fleshes them out<br />

ready for the implementation. Thus the objects identified during the <strong>an</strong>alysis act as the skeletons for the<br />

design. However, the designer must now consider how the <strong>an</strong>alysis objects (partitioned into packages)<br />

should be implemented. They must express the operations identified earlier in terms of algorithms<br />

which c<strong>an</strong> be implemented <strong><strong>an</strong>d</strong> associations as appropriate references from one object to <strong>an</strong>other (taking<br />

into account the type of facilities provided by the target l<strong>an</strong>guage). New classes may need to be<br />

introduced to deal with aspects which are import<strong>an</strong>t for the design (<strong><strong>an</strong>d</strong> ultimately the implementation)<br />

but are not signific<strong>an</strong>t for the <strong>an</strong>alysis.<br />

The following steps are performed by the designer during the object design:<br />

1. Combine the three models to obtain operations on the classes.<br />

2. Design algorithms to implement operations.<br />

3. Optimize access paths to data.<br />

4. Implement control for external interactions.<br />

5. Adjust class structure to increase inherit<strong>an</strong>ce.<br />

6. Design associations.<br />

7. Determine object representation.<br />

8. Package classes <strong><strong>an</strong>d</strong> associations into modules.<br />

As stated before, these steps are iterative.<br />

20.3.2.1 Combining the three models<br />

If the implied operations from the dynamic <strong><strong>an</strong>d</strong> functional models have not been added to the object<br />

model, then they should be added now.<br />

20.3.2.2 Designing algorithms<br />

Each of the DFD s in the functional model needs to be expressed as <strong>an</strong> algorithm to indicate how they<br />

perform the function. The DFD says what it does, but the algorithm says how it does it. The algorithm<br />

designer must:<br />

• Choose algorithms that minimize the cost of implementing operations.<br />

• Select data structures appropriate to the algorithms.<br />

• Define new internal classes <strong><strong>an</strong>d</strong> operations as necessary.<br />

• Assign responsibility for operations to appropriate classes.<br />

Note that <strong>an</strong>y algorithms defined in pseudo code during the <strong>an</strong>alysis phase were intended to explain<br />

the required functionality. It is therefore necessary at this stage to consider what algorithms are required<br />

in the implementation. For example, although a bubble sort algorithm may have been used in the<br />

<strong>an</strong>alysis phase, <strong>an</strong> insertion sort may well be a more efficient algorithm to chose for the design.<br />

168

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

Saved successfully!

Ooh no, something went wrong!