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

Create successful ePaper yourself

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

20.3 Design phase<br />

The aim of the <strong>an</strong>alysis phase is to identify what needs to be done <strong><strong>an</strong>d</strong> not how it is done. The design<br />

phase takes the models produced by the <strong>an</strong>alysis <strong><strong>an</strong>d</strong> considers how the requirements c<strong>an</strong> be achieved. It<br />

is broken down into two sub-phases. The first, called the system design, breaks the overall system down<br />

into components called subsystems, while the second, called the object design, moves the models<br />

produced towards the implementation.<br />

20.3.1 System design phase<br />

The subsystem architecture provides the context within which the more detailed design decisions, made<br />

during the object design, are performed. The subsystem decomposition defines <strong>an</strong> architecture which<br />

c<strong>an</strong> be used as the basis by which the detailed design c<strong>an</strong> be partitioned among a number of des igners,<br />

thus allowing different designers to work independently on different subsystems. The steps used to<br />

generate this architecture are:<br />

1. Org<strong>an</strong>izing the system into subsystems.<br />

2. Identifying concurrency inherent in the problem.<br />

3. Allocating subsystems to processors <strong><strong>an</strong>d</strong> tasks.<br />

4. Choosing <strong>an</strong> approach for m<strong>an</strong>agement of data stores.<br />

5. H<strong><strong>an</strong>d</strong>ling access to global resources.<br />

6. Choosing the implementation of control in software.<br />

7. H<strong><strong>an</strong>d</strong>ling boundary conditions.<br />

8. Setting trade offs between competing priorities.<br />

Of course not all these steps will be import<strong>an</strong>t for all applications. For example, a batch oriented, purely<br />

serial process, probably c<strong>an</strong>not have much concurrency imposed on it.<br />

20.3.1.1 Breaking the system into subsystems/packages<br />

Most systems will be comprised of a number of subs ystems, for example, a payroll system might<br />

possess a file subsystem, a calculation subsystem <strong><strong>an</strong>d</strong> a printing subsystem. A subsystem is not <strong>an</strong><br />

object nor a function, but a package of classes, associations, operations, events <strong><strong>an</strong>d</strong> constraints that are<br />

interrelated <strong><strong>an</strong>d</strong> that have a reasonably well -defined <strong><strong>an</strong>d</strong> (hopefully) small interface with other<br />

subsystems. The package notation in the UML c<strong>an</strong> be used to represent subsystems.<br />

A subsystem (or package) is usually characterized by the common (or associated) set of services that<br />

it provides. For example, the file package would provide a set of services to do with creating, deleting,<br />

opening, reading <strong><strong>an</strong>d</strong> writing files. The use case model may be useful in identifying such common<br />

services.<br />

Each package therefore provid es a well defined interface to the remainder of the system which<br />

allows other packages to use its facilities. Such a specified interface also allows the internals of the<br />

package to be defined independently of the rest of the system (i.e. it encapsulates th e package). In<br />

addition, there should be little or no interactions between objects within the package <strong><strong>an</strong>d</strong> objects in<br />

<strong>an</strong>other package (except via the specified interfaces).<br />

Packages c<strong>an</strong> be hierarchical <strong><strong>an</strong>d</strong> may be involved in client-server or peer to peer relationships with<br />

other packages. Client -server relationships are easiest to implement <strong><strong>an</strong>d</strong> maintain as one package<br />

responds to requests from <strong>an</strong>other package <strong><strong>an</strong>d</strong> returns results. In peer to peer relationships both<br />

packages must be capable of responding to r equests from the other. This c<strong>an</strong> result in unforeseen<br />

circularities.<br />

20.3.1.2 Identifying concurrency<br />

Concurrency c<strong>an</strong> be very import<strong>an</strong>t for improving the efficiency of a system. However, to take full<br />

adv<strong>an</strong>tage of concurrency the system must be designed around the c oncurrency inherent in the<br />

application. This c<strong>an</strong> be done by examining the dynamic model for objects which receive events at the<br />

same time or perform <strong>an</strong>y state tr<strong>an</strong>sitions (<strong><strong>an</strong>d</strong> associated actions) without interacting. Such tr<strong>an</strong>sitions<br />

166

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

Saved successfully!

Ooh no, something went wrong!