TweetFollow Us on Twitter

July 92 - Object-Oriented Analysis and Design Methods

Object-Oriented Analysis and Design Methods

Doug Rosenberg and Patti Jennett

As software development has progressed, the systems developed by software engineers have increased in complexity. Until recently, structured programming techniques were the most widely used for all phases of development, from analysis and design to implementation. As the systems we model in software have become more complex, many have found structured programming techniques lacking. Object-oriented programming (OOP) has been touted as solving many of the problems of programming complex systems, such as software manageability, code reuse, and continual change. Yet choosing an OOP implementation doesn't mean that you can forget about analysis and design.

Good software doesn't just write itself, even if you choose the "best" implementation technique (like object-oriented programming), or the "best" environment, or the "best" language. Good software must begin with a good design. A good design needs a good analysis of the problem domain so that those implementing the system are in tune with those who are commissioning the system. OOP needs both an analysis and design technique suited to the methodology. Figure 1 gives some examples of available analysis and design techniques.

Why Coad/Yourdon and Booch?

So which technique do you choose? Most of us are familiar with structured analysis and data flow diagrams, but those are ill suited for OOP. Object-oriented analysis and design techniques are relatively new and are proliferating rapidly as OOP matures. Several object-oriented analysis (OOA) methods (e.g., Shlaer/Mellor) have their roots in Information Modeling techniques, while other object-oriented design (OOD) methods (such as Booch) evolved from object-oriented programming methodologies. The one you choose may depend on whether you are coming from a structured analysis environment to an object-oriented one and want something familiar or you prefer to immerse yourself in pure object-oriented techniques from the beginning.

Today's popular OO modeling methods can be divided into two groups: those which have evolved down from Data Modeling and those which have evolved up from OOP practices. Examples of methods evolved from Data Modeling include Shlaer/Mellor, Rumbaugh, and Coad/Yourdon; examples of those evolved from OOP practice include Booch and Wirfs-Brock. In general, methods evolved from Data Modeling seem better suited to analysis, while methods evolved from OOP practice seem better suited to design. ICONIX chose the Coad/Yourdon and Booch methods for the initial version of ObjectModeler™ based on market feedback as to which OOA and OOD methods seemed to be gaining the greatest acceptance in the field.

Using structured analysis or analyzing data flow diagrams can be used as a front end to OOA or OOD. Thinking in those terms may help those new to OOP initially understand the problem better, but it is not optimal over the long term life of a program. Once analysts, designers, and programmers are trained in object-oriented techniques, continually going back to structured techniques when making changes to the system adds an unnecessary step to the life-cycle.

Coad/Yourdon and Booch provide more "pure" methods of analysis and design. They start with viewing the problem domain from an object-oriented vocabulary. A "pure" object-oriented method allows for easier refinement of the problem over the life-cycle of the application.

What is OBJECT-ORIENTED Analysis?

Grady Booch, in his book Object-Oriented Design with Applications, states: "Object-oriented analysis is a method of analysis that examines requirements from the perspective of the classes and objects found in the vocabulary of the problem domain." This definition brings up three key elements: classes, objects and problem domain.

Coad and Yourdon, in their book Object-Oriented Analysis, define problem domain as "A field of endeavor under consideration." They give examples of problem domains as air space management, avionics, finance, and law. These example problem domains are rather broad, so we are not finished here. Coad and Yourdon also state that "OOA is the challenge of understanding the problem domain, and then the system's responsibilities in that light."

Coad/Yourdon describe an object as "An abstraction of something in a problem domain, reflecting the capabilities of a system to keep information about it, interact with it, or both; an encapsulation of Attribute values and their exclusive Services. (synonym: an Instance)." They describe a class as "A description of one or more Objects with a uniform set of Attributes and Services, including a description of how to create new Objects in the Class."

With these definitions in mind, let's examine the Coad/Yourdon OOA methodology.

Coad/Yourdon - The Method

Coad and Yourdon base their approach to OOA on 8 principles for managing complexity. Those principles are Abstraction (both Data and Procedural), Encapsulation, Inheritance, Association, Communication with messages, Pervading methods of organization (subdivided into Objects and attributes, Whole and parts, Classes and members, and distinguishing between them), Scale, and Categories of behavior (Immediate causation, Change over time, Similarity of functions). These principles are very similar to the Object Model used by Booch, described below.

The overall approach consists of five major activities. They are Finding Class-&-Objects, Identifying Structures, Identifying Subjects, Defining Attributes, and Defining Services. From these five activities, they arrive at a five layer model of OOA. The five layers are the Subject Layer, Class-&-Object Layer, Structure Layer, Attribute Layer, and Service Layer.

Subjects are used to give a higher level overview of the problem domain than the class and object level. They are used as a guide through a large model.

Class-&-Object is a term meaning "a Class and the Objects in that Class." In general, over time, Class-&-Objects remain stable. They provide the basis for moving towards reusable analysis. Attributes and Services describe the Class-&-Object in more detail. They represent the Object's state (or data) and its behavior (processes). While the Class-&-Objects are not likely to change over time, the Attributes and Services may change radically.

Structures are divided into two types, the "is a" or "is a kind of" structure and the "has a"Ęstructure. Coad/Yourdon call these the Generalization-Specialization (Gen-Spec) and Whole-Part structures.

What is OBJECT-ORIENTED Design?

Booch defines OOD as follows: "Object-oriented design is a method of design encompassing the process of object-oriented decomposition and a notation for depicting both logical and physical as well as static and dynamic models of the system under design." In other words, OOD uses classes and objects to structure systems, as opposed to algorithmic abstractions used by structured design. It also uses a notation that expresses classes and objects (the logical decomposition) as well as modules and process (the physical decomposition).

Booch - The Method

The Object Model

According to Booch, there are four major elements of the Object Model: Abstraction, Encapsulation, Modularity, and Hierarchy. A model must have all four of these elements to be object-oriented. In addition, there are three minor elements of the Object Model: Typing, Concurrency, and Persistence. Each of these elements is useful to the model, but not essential. The elements of the Object Model help you make use of the full power of the object-oriented language used for implementation. Without them, for example, an Object Pascal implementation will look like Pascal, a C++ implementation will look like C, etc. (and we all know that good FORTRAN programmers can write FORTRAN in any language).

So what are Abstraction, Encapsulation, Modularity, and Hierarchy? In brief, Abstraction is the process of identifying the essential characteristics of an object that distinguish it from all other kinds of objects. Basically it is identifying your classes and objects. Booch provides a wonderful chapter on how to identify your classes and objects, which we highly recommend.

Encapsulation is another term for information hiding. While Abstraction focuses on how the object is viewed from the outside, Encapsulation focuses on what can only be seen from inside the object perspective.

Modularity is how one partitions a program. It creates well-defined, documented boundaries within a program. These boundaries can provide logical separation between the objects of an application, to separate out reusable parts. Sometimes they are used to partition out the work to individual programmers (hopefully in a logical manner).

Hierarchy is defined by Booch as the "ranking or ordering of abstractions." Hierarchy defines the structure of your complex system, the "kind of" class structure and the "part of" object structure. Inheritance is classified as a "kind of" hierarchy, and is sometimes called the "is a" hierarchy.

The Method

Booch addresses both a Logical and a Physical view of design, with both Static and Dynamic aspects of each. He segments Logical Design into Class Structure and Object Structure, and Physical Design into Module Architecture and Process Architecture. From this view of design, he comes up with a notation that includes four basic diagrams: class diagrams, object diagrams, module diagrams, and process diagrams. These are mainly static representations. To represent the dynamic aspects he also uses two supplementary diagrams in his notation: state transition diagrams and timing diagrams.

A class diagram shows the class structure using classes, the relationship between classes (such as class A uses class B or class C instantiates class D for example), and class utilities (a free subprogram or group of them). Class diagrams are largely static. For large systems, the class structure may be too large to represent in one diagram so class category diagrams are used to organize the classes. The use of class categories is analogous to the use of subjects in the Coad/Yourdon methodology.

Object diagrams show the existence of objects and their relationships to each other. Objects tend to be transitory during the execution of a program, so object diagrams show only a snapshot of the object at a given period of time. Each object on an object diagram shows some specific instance of a class.

Module diagrams show the allocation of classes, class utilities, objects, and other declarations of the physical module. This diagram is only used when the implementation language supports it.

Process diagrams are used for multi-process systems. They are used to visualize the allocation of processes to processors.

State transition diagrams (STDs) show the state space of a class, the events that cause a transition from one state to the other, and the actions that result from the change of state. Coad and Yourdon use STDs as well.

Timing diagrams show the dynamic interactions of various objects on the object diagram. For example, they can show over time, how operation 1, associated with object A, can invoke operation 2, associated with object B.

How can CASE Tools Help?

CASE tools help in many ways. They provide a common communication medium for a team of developers and help a team of analysts and designers to stay in synch. They provide a standard graphics vocabulary, which lends itself to conformity among diagrams. They also make the whole problem of documentation much easier, taking the grunt work out of documentation.

ICONIX has implemented ObjectModeler™ to support both the Coad/Yourdon OOA and Booch OOD methods; specifically, Coad/Yourdon Class-&-Object and Service diagrams, and Booch Class, Class Category, and Object diagrams. ObjectModeler™ allows, via a diagram editor, the end user to draw and manipulate instances of these diagram types.

Both the Booch and Coad/Yourdon methods also make use of State Transition Diagrams; ICONIX supports STDs in the FastTask™ module. Booch also makes use of Module and Process Architecture diagrams; the ICONIX AdaFlow™ module may be used to create these (since Booch's Module diagram is very similar to his Ada diagramming notation). Finally, Booch proposes the use of Timing diagrams but states that these may be replaced by PDL. ObjectModeler's Language Sensitive Editor supports PDL in addition to C++. Those developers who do choose to work in PDL will probably find the ICONIX PowerPDL module useful, as well.

Examples

FigureTwo shows an example of the Coad/Yourdon OOA notation, describing the Coad/Yourdon methodology. There are 3 subjects on the diagram: Class-&-Objects, Structures, and Subjects, which are described as follows:
  1. Class-&-Objects have Attributes and Services, and are connected by Instance Connections and Message Connections. Services may be shown on child diagrams called Service Charts.
  2. Structures can be Gen-Spec Structures (is a), or Whole-Part Structures (part of).
  3. Subjects can contain multiple Class-&-Objects and Structures; there can be multiple subjects in an OOA Model.

Figures Three and Four on the next page show a partial class diagram for MacApp 2 and an object diagram of MacApp's menu command mechanism using the Booch OOD notation. The class diagram shows the portion of the class hierarchy which is important to the menu command mechanism.

gTarget, a global variable, is the start of the command chain. Its declared type is the class TEvtHandler, so during execution it can be an instance of TEvtHandler or one of its subclasses (from figure 3 we see that this is TApplication, TDocument, TView, TScroller or TWindow). The TEvtHandler class has a field (or attribute, if you prefer), fNextHandler, of type TEvtHandler. During execution this field is set so that every subview points to its superview (declared as type TView), every window points to its enclosing document, and every document points to its application object. When a user selects a menu item, the DoMenuCommand method is invoked for the object designated by gTarget. If that object is unable to respond to it, then the same command message is passed around the command chain until an object handles it or nil is returned in fEventHandler.

As you can see, none of this is evident by simply looking at the class diagram, and without the class diagram the object diagram is missing something. The diagrams complement each other, providing the reader a greater understanding of the whole.

Conclusion

One of the hardest parts of object-oriented programming is coming up with the best set of objects to describe the problem domain, especially one that is complex and ever changing (the marketing guys want what? by tomorrow?!). There are often deadlines to meet, and we tend to want to jump in and start programming right away. Don't do it! First we need to analyze the problem domain and design a system that meets the requirements, before we implement it, otherwise we can end up with code that is not reusable, or continually needs to be "patched" or rewritten (from the ground up).

The combination of Coad/Yourdon OOA and Booch OOD provide a synergistic method for analysis and design. The principles laid out by Coad and Yourdon are very similar to the Object Model used by Booch's notation. Their notations use an object-oriented visualization to describe the problem domain, not structured analysis. This lends itself well to an object-oriented implementation and in the end leads to more manageable code. It also has one final bonus-not only do you have reusable code, you have reusable analysis and design as well.

Parting Comments

Given limited time and deadlines, we couldn't put everything that we wanted to into this article. We hope to have a second part to this article in the next issue of FrameWorks that goes through, step by step, a complete example of OOA and OOD, starting with the Coad/Yourdon OOA method following through to the Booch OOD method.

If you have any comments or questions, please feel free to link us (see AppleLink addresses above), or call us at (310) 458-0092, or write to us at ICONIX Software Engineering, 2800 28th Street, Suite 320, Santa Monica, CA 90405. n

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »
Explore some of BBCs' most iconic s...
Despite your personal opinion on the BBC at a managerial level, it is undeniable that it has overseen some fantastic British shows in the past, and now thanks to a partnership with Roblox, players will be able to interact with some of these... | Read more »

Price Scanner via MacPrices.net

You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more
Sunday Sale: 13-inch M3 MacBook Air for $999,...
Several Apple retailers have the new 13″ MacBook Air with an M3 CPU in stock and on sale today for only $999 in Midnight. These are the lowest prices currently available for new 13″ M3 MacBook Airs... Read more
Multiple Apple retailers are offering 13-inch...
Several Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices... Read more
Roundup of Verizon’s April Apple iPhone Promo...
Verizon is offering a number of iPhone deals for the month of April. Switch, and open a new of service, and you can qualify for a free iPhone 15 or heavy monthly discounts on other models: – 128GB... Read more

Jobs Board

Relationship Banker - *Apple* Valley Financ...
Relationship Banker - Apple Valley Financial Center APPLE VALLEY, Minnesota **Job Description:** At Bank of America, we are guided by a common purpose to help Read more
IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: Apr 9, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 824398 At Target Optical, we help people see and look great - and Read more
Medical Assistant - Orthopedics *Apple* Hil...
Medical Assistant - Orthopedics Apple Hill York Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.