Advertisement

What is Object-Oriented Analysis and Design?(OOAD)

What is Object-Oriented Analysis and Design?(OOAD)

What are Analysis and Design?
       The analysis emphasizes an investigation of the problem and requirements, rather than a solution. For example, if a new online trading system is desired, how will it be used? What are its functions?

       The design emphasizes a conceptual solution (in software and hardware) that fulfills the requirements, rather than its implementation. For example, a description of a database schema and software objects.

What is Object-Oriented Analysis and Design?
       During object-oriented analysis, there is an emphasis on finding and describing the objects — or concepts — in the problem domain. For example, in the case of the flight information system, some of the concepts include Plane, Flight, Pilot.

       During object-oriented design, there is an emphasis on defining software objects and how they collaborate to fulfill the requirements.

     For example, a Plane software object may have a tailNumber attribute and a getFlightHistory method (see fig.)


Fig. Object-orientation emphasizes representation of objects.

     Finally, during implementation or object-oriented programming, design objects are implemented, such as a Plane class in Java.

An Example of Object – Oriented Analysis and Design: “A Dice Game”
      The dice game is very simple problem, presented in order to focus on some of the steps and artifacts in object – oriented analysis and design rather than on the problem domain.
      A "dice game" in which a player rolls two dice. If the total is seven, they win; otherwise, they lose.
Most essential and commonly used steps in OOAD:

Define Use Cases
      Requirements analysis may include stories or scenarios of how people use the application; these can be written as use cases. They are a popular tool in requirements analysis.

For example, here is a brief version of the Play a Dice Game use case:

Play a Dice Game: Player requests to roll the dice. System presents results: If the dice face value totals seven, player wins; otherwise, player loses.
Use case diagram

Define a Domain Model
A decomposition of the problem domain involves an identification of

  • Concepts
  • Attributes
  • Associations
in the domain that are considered important.

A domain model is a visualization of the concepts of a real-world domain. Thus, it has also been called a conceptual object model.

The result can be expressed in a conceptual model, which is illustrated in a set of diagrams that depict concepts (objects).

For example, a partial domain model is shown in fig.


Fig. Partial domain model of the dice game.

This model illustrates the concepts Player, Die, and DiceGame, with their associations and attributes.

Assign Object Responsibilities and Draw Interaction Diagrams
Object - oriented design is concerned with defining logical software specifications that fulfill the functional requirements based on decomposition by classes of objects.

An essential step in this phase is the allocation of responsibilities to objects and illustration how they interact via messages, expressed in collaboration diagrams.

Collaboration diagrams show the flow of messages between instances and the invocation of methods.

For example, the sequence diagram in Fig. illustrates an OO software design, by sending messages to instances of the DiceGame and Die classes. Note this illustrates a common real-world way the UML is applied: by sketching on a whiteboard.


Fig. Sequence diagram illustrating messages between software objects.

The collaboration diagram in Figure illustrates the essential step of playing by sending messages to instances of the Player and die classes.

Fig. Collaboration diagram illustrating messages between software objects.

Define Design Class Diagrams
“These illustrate class definitions that are to be implemented in software”

In order to define a class, several questions must be answered:

  • How do objects connect to other objects?
  • What are the methods of a class?
To answer these questions, For example, in the dice game, an inspection of the sequence diagram leads to the partial design class diagram shown in Fig. Since a play message is sent to a DiceGame object, theDiceGame class requires a play method, while class Die requires roll() and getFaceValue() method.

Fig. Partial design class diagram.

Post a Comment

0 Comments