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.

geographic information system. These facilities could then be used to construct a concrete<br />

payroll (or GIS) system with the features required by a specific org<strong>an</strong>ization.<br />

• Domain frameworks encapsulate expertise in a particular problem domain. These frameworks<br />

encompass a vertical slice of functionality for a particular client domain. Examples of domain<br />

frameworks include: a control systems framework for developing contro l applications for<br />

m<strong>an</strong>ufacturing systems or drawing frameworks such as HotDraw, Unidraw for C++/X windows<br />

<strong><strong>an</strong>d</strong> DRAW_Master for C++/OS 2 <strong><strong>an</strong>d</strong> Windows environments.<br />

• Support frameworks provide system -level services, such as file access, distributed computing<br />

support, or device drivers. Application developers typically use support frameworks directly or<br />

use modifications produced by system providers. However, even support frameworks c<strong>an</strong> be<br />

customized - for example when developing a new file system or device driver.<br />

Since frameworks are reusable designs, not just code, they are more abstract th<strong>an</strong> most software<br />

which makes documenting them more difficult. Documentation for a framework has three purposes <strong><strong>an</strong>d</strong><br />

patterns c<strong>an</strong> help to fulfill each of them. Documentation must provide:<br />

1. the purpose of the framework,<br />

2. how to use the framework,<br />

3. the detailed design of the framework.<br />

21.2.2 Designing object-oriented frameworks<br />

The process of designing <strong><strong>an</strong>d</strong> implementing frameworks is not trivial <strong><strong>an</strong>d</strong> is, in m<strong>an</strong>y ways, harder th<strong>an</strong><br />

designing <strong><strong>an</strong>d</strong> implementing a one off application. This is because the framework needs to be complete,<br />

robust, generic, easy to use, extensible <strong><strong>an</strong>d</strong> flexible if it is to be effective:<br />

• Complete. A framework must provide all the infrastructure required to construc t applications.<br />

This includes documentation, concrete examples as well as the underlying skeleton of the<br />

framework. If <strong>an</strong>y of these are missing (in particular the underlying skeleton) then this will act as<br />

<strong>an</strong> impediment to the adoption of the framework.<br />

• Robust. A framework that is not robust will soon be ignored as users will not w<strong>an</strong>t to have to<br />

debug the framework as well as their own code.<br />

• Generic. A framework that is not generic (relative to its application area) will be difficult to<br />

apply except in very specific ways. This c<strong>an</strong> reduce the incentive for org<strong>an</strong>izations to adopt a<br />

framework.<br />

• Easy to use . A framework which is difficult to use will not be adopted as few developers have<br />

the time to gain the necessary underst<strong><strong>an</strong>d</strong>ing to take adv<strong>an</strong>tage of such a framework.<br />

• Extensible. Users of the framework should find it easy to add <strong><strong>an</strong>d</strong> modify default functionality.<br />

That is, the framework should provide hooks so that users c<strong>an</strong> apply the framework in different<br />

ways.<br />

• Flexible. One of the claimed benefits of frameworks is that they c<strong>an</strong> be applied <strong><strong>an</strong>d</strong> used in ways<br />

which were not envisaged by their creators. They therefore need to be flexible.<br />

The first step in developing a framework is to <strong>an</strong>alyze the application problem domain such that you<br />

know the requirements of <strong>an</strong>y frameworks, the types of frameworks that would be useful <strong><strong>an</strong>d</strong> how they<br />

might be used. For example, look for the types of subsystems which are built repeatedly. A pseudo<br />

natural l<strong>an</strong>guage parser might be a common subsystem within a r<strong>an</strong>ge of diagnostic tools.<br />

The next step involves identifying what is common about these systems <strong><strong>an</strong>d</strong> what is different. This<br />

allows the identification of the primary abstractions for the framework. These are the components<br />

which are const<strong>an</strong>t across applications (even though they ma y have different names in these different<br />

applications). Note that it is often easiest to work bottom up in identifying these abstractions (in some<br />

cases the designs of the system might be the best starting points <strong><strong>an</strong>d</strong> in others the source code).<br />

The third step involves taking these abstractions <strong><strong>an</strong>d</strong> constructing a skeleton for the framework. This<br />

skeleton should provide the basic infrastructure (comprised of the abstract concepts) for the framework.<br />

This is a bit like attempting to produce a set of abstract classes <strong><strong>an</strong>d</strong> their interactions for some<br />

application, without filling out all (or most) of the concrete classes.<br />

172

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

Saved successfully!

Ooh no, something went wrong!