0% found this document useful (0 votes)
10 views34 pages

Chapter10 Design and Implementation

Uploaded by

AlexJohn25111983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views34 pages

Chapter10 Design and Implementation

Uploaded by

AlexJohn25111983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Chapter 10

Design and
Implementation
Prepared by: Mr. KAY HENG
Objective

After complete the “Design and Implementation”, Student will be able

• Explain the step of Design stage in Development Methodology


• Draw Sequence Diagram according to the USED CASE Model
• Define Functionalities and activities in the Project according to Requirements
Introduction

• We use the class structure produced by the analysis to design a


system that behaves in the manner specified by the model

• The main UML tool that we employ here is the sequence diagram

• Designer specifies the details of how the behavior specified in the


model will be realized.

• The process requires the system’s actions to be broken down into


specific tasks, and the responsibility for these tasks to be assigned to
the various players in the system
Introduction

• Designer thus breaks down the system into smaller units and
provides enough information so that a programmer can code and test
each unit separately

• After the design is complete, we proceed to the implementation


stage
Key Concepts of OOAD

• Sequential Diagram in Design


• Implementation
Design

During the design process, a number of questions need to be


answered:
• On what platform(s) (hardware and software) will the system run?
• What languages and programming paradigms will be used for
implementation?
• What user interfaces will the system provide?
• What classes and interfaces need to be coded? What are their
responsibilities?
• How is data stored on a permanent basis? What medium will be used? What
model will be used for data storage?
• What happens if there is a failure? Ideally, we would like to prevent data loss
and corruption. What mechanisms are needed for realising this?
• Will the system use multiple computers? If so, what are the issues related to
data and code distribution?
• What kind of protection mechanisms will the system use?
Design: Major subsystem

The first step in our design process is to identify the major subsystems.
We can view the library system as composed of two major subsystems:

• Business logic This part deals with input data processing, data creation,
queries, and data updates. This module will also be responsible for interacting
with external storage, storing and retrieving data.

• User interface This subsystem interacts with the user, accepting and outputting
information.

It is important to design the system such that the above parts are
separated from each other so that they can be varied independently

We also implement a mechanism for storing and retrieving data by


interacting with external storage devices
Desing: Creating the software
classes
• During the analysis, after defining the use case model, we came up with
a set of conceptual classes and a conceptual class diagram for the
entire system. In this phase there are two major activities.

• Come up with a set of classes.


• Assign responsibilities to the classes and determine the necessary data
structures and methods.
• The classes for the business logic module will be the ones instrumental
in implementing the system requirements described in the use case
model
• In our analysis, we came up with a set of conceptual classes and
relationships
• It is, therefore, reasonable that as a ‘first guess’ for the required
software classes for the business logic, we pick these conceptual classes
Desing: Creating the Software
classes
• Create the Conceptual Classes:

• Member and Book


• Library Do we really need to make a class for this?
• Borrows This class represents the one-to-many relationship between
members and books.
• Holds Unlike Borrows, this class denotes a many-to-many relationship
between the Member and Book classes

• Please more read on the page 160 in the book Object Oriented
Analysis and Design
Desing: Assigning
Responsibilities to the Classes
• To assign responsibilities to a set of Classes in the software

• the ultimate purpose of these classes is to enable the system to meet


the responsibilities specified in the use case to assign to these classes

• To details of how the system meets its responsibilities by devolving


these down to the software classes that describe the devolutions in
the sequence diagram

• For each system response listed in the right-hand column of the use
case tables, we need to specify the following:
• The sequence in which the operations will occur.
• How each operation will be carried out.
Desing: Assigning
Responsibilities to the Classes
• Register Member
Let us see details of the addMember method. The algorithm here
consists of three steps:
1. Create a Member object.
2. Add the Member object to the list of members.
3. Return the result of the operation.

To carry out the first two steps, we have two options:


• Option 1 Invoke the Member constructor from within the addMember method
of Library. The constructor returns a reference to the Member object and an
operation, insertMember, is invoked on MemberList to add the new member.
• Option 2 Invoke an addNewMember method on MemberList and pass as
parameters all the data about the new member. MemberList creates the
Member object and adds it to the collection.
Desing: Assigning
Responsibilities to the Classes
• Register Member
Desing: Assigning
Responsibilities to the Classes
• Add Books
Desing: Assigning
Responsibilities to the Classes
• Issue Books
Two options suggest themselves for implementing the search:

• Option 1 Get an enumeration of all Member objects from MemberList, get


the ID from each and compare with the target ID.
• Option 2 Delegate the entire responsibility to MemberList.
Desing: Assigning
Responsibilities to the Classes
• Issue Books
Desing: Assigning
Responsibilities to the Classes
• Return Books
Desing: Assigning
Responsibilities to the Classes
• Remove Books
Desing: Assigning
Responsibilities to the Classes
• Member’s Transaction
Desing: Assigning
Responsibilities to the Classes
• Place Hold
Desing: Assigning
Responsibilities to the Classes
• Process Hold
Desing: Assigning
Responsibilities to the Classes
• Remove Hold
Desing: Assigning
Responsibilities to the Classes
• Renew Books
Desing: Class Diagrams

• We have produced all the software classes. To review:

• Library
• MemberList
• Catalog
• Member
• Book
• Hold
• Transaction
Desing: Class Diagrams

• Library
Desing: Class Diagrams

• Member
Desing: Class Diagrams

• Book
Desing: Class Diagrams

• Catalog

• MemberList
Desing: Class Diagrams

• Hold
Desing: Class Diagrams

• Transaction
Desing: User Interface

• Our UI provides a menu with the following options:


1. Add a member
2. Add books
3. Issue books
4. Return books
5. Renew books
6. Remove books
7. Place a hold on a book
8. Remove a hold on a book
9. Process holds
10. Print a member’s transactions on a given date
11. Save data for long-term storage
12. Retrieve data from storage 0 Exit
13. Help
Desing: Data Storage

• most applications will need to store data on a long-term basis

• In the full-blown system, data is usually stored in a database, and this


data is managed by a database management system

• we will adopt a simple approach to store data on a long-term basis to


a void digressing

• we had decided to include the following commands in our UI


• A command to save the data on a long-term basis.
• A command to load data from a long-term storage device.
Implementing our Design

• Implementation the project using Java Programming Language.


Follow the above our Design in Library System

• Read Chapter 7 and 8 for implementation of Object-Oriented


Analysis, Design and Implementation Second Edition
Q&A
Thank you

You might also like