Object Oriented System Basics
Object Oriented System Basics
The system where overall architecture is perceived as a collection of objects that are assigned
specific responsibilities and hence exhibit their behavior based on the type of responsibility
assigned to them.
I. Objects
- An object is an instance of a class.
- Example: student, Teacher, Patient, Doctor, Bank account etc.
II. Attributes
III. Class
IV. Method
Methods determine the behavior of a class. They are nothing but an action or operations that
an object can perform.
V. Message
A message is a function call or procedure call from one object to another. They are information
sent to object to trigger method.
Features of Object Oriented System
a. Encapsulation
b. Abstraction
It is the process of taking or selecting necessary method and attributes to specify the object. It
focuses on essential characteristics of an object relative to perspective of users. Example: If you
wish to withdraw money from ATM, the only concern is to receive money and not the internal
working of ATM.
c. Relationships
All the classes in the system are related with each other. The object do not exist in isolation,
they exist in relationship with other objects.
d. Inheritance
Inheritance is a great features that allows to create sub – classes from an existing class by
inheriting the attributes and operations of existing classes.
e. Polymorphism
Polymorphism is the ability to take on many different forms. It applies to both object and
operations. A polymorphic object is one who true type hides within a super or parent class.
In polymorphic operation, the operation may be carried our differently by different classes of
objects. It allows is to manipulate objects of different classes by knowing only their common
properties.
Structured Approach Vs Object – Oriented Approach
Decomposition
It is the process of partitioning the problem domain into smaller parts so that the overall
complexity of the problem can be comprehended and tackled easily (divide and conquer
approach)
Dividing the problem domain into smaller parts by focusing on the functionalities that the
system provides. For example functionalities of a Library Management System may include
issue_book, return_book, search_book
Dividing the problem domain into smaller parts by focusing on the objects with specific
responsibilities that form the system. For example, objects in a Library Management System
may include IssueManager, Book, Librarian.
- 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 and pilot.
- OO analysis is to identify objects of a system to be designed.
- It is a method of analysis that examines requirements from the perspective of the classes and
objects found in the vocabulary of the problem domain.
- Object oriented analysis can be defined as a structured process of investigation and in – depth
investigation of the problem domain is done during this phase by asking the WHAT questions
(rather than HOW solution is achieved).
- The next step after completing the analysis of the requirement is to translate it to the design
of the proposed system.
- 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
- After the introduction of OO design, the consideration for the reusability has got high focus.
- With the popularity of the OO language like c++ and java the code with which the design and
the code can be mapped with each other increased manifold creating the way for automatic
code generation from the design itself.
- A in - depth investigation of the problem domain is done during this phase by asking the HOW
question (How solution is achieved?)
Difference between Object – oriented analysis and Object – oriented Design
We describe these above modules by giving simple example of a “dice game” in which software
simulates a player rolling two dice, It the total is seven they win otherwise they lose.
For example
For example
Note
Note
The design class diagram is not the same as the domain model class names and content are
similar.
Requirement
Capabilities and conditions to which the system and more broadly, the project must conform a
prime challenge of requirements work (fact finding) is to find, communicate, and record what is
really needed, in a form that clearly speaks to the client and development team members.
Types of requirements:
Functional (Behavioral)
calculations, technical details, data manipulation and processing and other specific functionality
Types of requirements
FURPS +
An acronym representing a model for classifying software quality attributes (functional &
non-functional requirement)
• Fact-Finding Overview
– First, you must identify the information you need
– Develop a fact-finding plan
Fact finding can be done through Document review, observation, questionnaire, surveys,
sampling, research.
2. Interviewing
The analyst starts by asking context-free questions;
- a set of questions that will lead to a basic understanding of the problem, the people who
want a solution, the nature of the solution desired, and the effectiveness of the first
encounter itself.
Structured Questioning Techniques usually lead by software engineer :
- why are we building this system
- who are the other users
- determine critical functionality
The idea is to overcome we/them attitude between developers and users team-oriented
approach
Guidelines
Unified Process
Because the Unified Process (UP) is a relatively popular iterative process for projects using OOA/D
and because some process must be used to introduce the subject, the UP shapes the book’s
structure. Also, since the UP is common and promotes widely recognized best practices, it’s
useful for industry professionals to know it, and students entering the workforces to be aware of
it.
The UP is very flexible and open and encourages including skillful practices from other iterative
methods such as from Extreme Programming (XP), Scrum and so forth.
Summarize
1. The UP is an iterative process. Iterative development influences how this book introduces
OOA/D and how it is best practiced.
2. UP practices provides an example structure for how to do – and thus how to explain – OOA/D.
That structure shapes the book structure.
3. The UP is flexible and can be applied in a lightweight and agile approach that includes
practices from other agile methods.
Phases of UP
1. Inception
Approximate vision, business case, scope, vague estimate.
Inception is not a requirement phase; rather it is a feasibility phase, where just enough
investigation is done to support a decision to continue or stop.
During the inception phase, the basic idea and structure of the project is determined. The
team will sit down and determine if the project is worth pursuing at all.
It establishes business cases system, all the external entities people and system that will
interact with the system are identified and define these interactions.
Based on the proposed purpose of the system, the estimated costs and what resources will
be required to complete the project once the green light is given.
2. Elaboration
Refined vision, iterative implementation of the core architecture, resolution of high risks,
identification of most requirements and scope, more realistic estimates.
Elaboration is not the requirements or design phase; rather, it is a phase where the core
architecture is iteratively implemented and high – risk issues are mitigated.
This phase develop an understanding of the problem domain, establish an architectural
framework for the system develop the project plan and identify key risks.
The purpose of the elaboration phase is to analyze the requirements and
necessary architecture of the system.
The success of this phase is particularly critical, as the final milestone of this phase signifies
the transition of the project from low – risk to high - risk.
3. Construction
Iterative implementation of the remaining lower risk and easier elements and preparation for
deployment.
The construction phase is essentially concerned when the design, coding and testing of all
application features will take place.
This period is also where integration with other services or existing software should occur.
The end of the construction phase is measured by the completion of the initial
operational capability milestone, which is based on these criteria:
4. Transition
Beta tests, deployment
This phase is concerned with moving the system from development community to user
community and making it work in real environment.
However, the transition phase is more than just the process of deployment; it
must also handle all post – release support, bug fixes, patches and so forth.
The product release milestone signals the end of the transition phase and is based on a few
simple question:
UP Disciplines
There are several discipline in the UP; some artifact in the following three:
Business Modeling: The Domain Model artifact, to visualize noteworthy concepts in the
application domain.
Requirement: The use case model and supplementary specification artifacts to capture
functional and non functional requirement.
Design: The design model artifact, to design the software objects.
In above figure, during one iteration work goes on in most or all disciplines. The relative effort
across these disciplines changes over time. Early iteration naturally tend to apply greater
relative emphasis to requirements and design and later one less.
Relating disciplines to the UP phases illustrate the changing relative effort with respect to the
phases.
Here in elaboration, the iteration tend to have a relatively high level of requirements and
design work, although definitely some implementation as well.
During construction the emphasis is heavier on implementation and lighter on requirements
analysis.
Use cases: Describing processes
Use case is a collection of related success and failure scenarios that describe an actor using a
system to support a goal.
It is a narrative document that describes the sequence of events of an actor (an external
agent) using a system to complete a process.
The essence is discovering and recording functional requirements by writing stories of using
a system to help fulfill various stakeholder goals.
Actor
It is an entity that is external to the system, who in some way participates in the story of Use
Case.
An actor physically stimulates the system with input events or receives something form it.
An actor is anything with behavior, including the system under discussion itself when it call
upon the services of other systems. Eg, a cashier
Actors are represented by the role they play in the Use Case.
a. Primary Actor: has user goals fulfilled through using services of the system under discussion.
E.g Cashier
These are identified to find user goal that drive the use cases.
These are identified to ensure all interests are identified and satisfied.
Scenario:
A scenario is a specific sequence of actions and interactions between actors and the system
under discussion; it is also called a use case instance.
A use case is a collection of related success and failure scenarios that describes an actor using
system to support a goal.
Use cases are functional or behavioral requirements that indicate what the system will do.
For example, the scenario of successfully purchasing items with cash or the scenario of failing
to purchase items because of a credit payment denial.
Handle Returns
A customer arrives at a checkout with item to return. The cashier uses the POS system to record
each returned item……
Alternate Scenarios
If the customer paid by credit and the reimbursement transaction to their credit account is
rejected, inform the customer and pay them with cash.
If the item identifier is not found in the system, notify the cashier and suggest manual entry of
the identifier code.
If the system detects failure to communicate with the external accounting system……
Now that scenario (use case instance) are defined, an alternate, but similar definition of a use
case provided by the RUP will make better sense:
A set of use – case instances, where each instance is a sequence of actions a system performs
that yields an observable result of value to a particular actor.
All expanded use cases, remain relatively free of technology and implementation details
Design decisions are deferred and abstracted. That is only essential activities and motivations.
High level use cases are always essential in nature due to their brevity and abstraction.
Concretely describes the process in terms of its real current design, committed to specific I/O
technology etc.
This helps the designer to identify what task the interaction diagram may fulfill, in addition
to what is in contract.
Process Sale:
A customer arrives at a checkout with items to purchase. The cashier uses the POS (point of sale)
system to record each purchased item. The system presents a running total and line – item
details. The customer enters payment information, which the system validates and records. The
system updates inventory. The customer receives a receipt from the system and then leaves with
the items.
- Brief
- Casual
- Fully Dressed
Brief
Casual
Fully dressed
All steps and variations are written in detail and there are supporting sections, such as
preconditions and success guarantees.
Fully dressed use cases shows more detail and are structured; they dig deeper.
In iterative and evolutionary UP requirement analysis, 10% of the critical use cases would be
written this way during the first requirements workshop. Then design and programming
starts on the most architecturally significant use cases or scenarios from that 10% set.
Success Guarantee (Postconditions): Sale is saved. Tax is correctly calculated. Accounting and
inventory are updated. Commission recorded. Receipt is generated. Payment authorization
approvals are recorded.
It is just a software application, the hardware and application as a unit, that plus a person
using it or an entire organization?
For example, The POS system itself is the system under design. If the definition of the boundary
of the system under design is not clear, it can be clarified by further definition of what is outside
(the external actor and supporting actor)
Is the complete responsibility for payment authorization within the system boundary?
Identify the primary actor and Identify goal for each primary actor
It is more difficult to identify the primary actors before user goals in a requirement workshop,
people brainstorm and generate a mixture of both. Sometimes, goal reveal the actor or vice
versa.
For example
Actor Goal
Cashier Process sales,
Process rentals,
Handle returns,
Cash in,
Cash out
Manager Start up,
Start down
System Administration Add users,
Modify users,
Delete users,
Manage security,
Manage system tables
Sales Activity System Analyze sales and performance data
Etc,
Another way to find actors, goal and use cases is to identify external events. What are they,
where from and why? Often, a group of events belong to the same use case. For example
In general, define one use case for each user goal. Name the use case similar to the user goal.
For example:
A use case describes interaction with the system. Typical boundaries includes
Scenario one:
If we choose the entire store or business as the system then the only customer is an actor not
the cashier because the cashier acts as a resource within the business system.
Scenario two:
If we choose the point of sale hardware and software as the system both cashier as well as
customer may be treated as actors.
Include
When a use case is depicted as using functionality of another functionality of another use
case, this relationship between the use cases is named as an ―include‖ or ―uses‖
relationship.
A use case includes the functionality described in another use case as a part of its business
process flow.
The include relationship adds additional functionality not specified in the base use case. The
<> relationship is used to include common behavior from an included use case into a base
use case in order to support re-use of common behavior.
An include relationship is depicted with a directed arrow having a dotted line. The tip of
arrowhead points to the child use case and the parent use case connected at base of the
arrow.
The stereotype "<>" identifies the relationship as an include relationship.
Extends
The extend relationships are important because they show optional functionality or system
behavior. The <> relationship is used to include optional behavior from an extending use case
in an extended use case.
Indicates that an "Invalid Password" use case may include (subject to specified in the
extension) the behavior specified by base use case "Login Account".
Depict with a directed arrow having a dotted line. The tip of arrowhead points to the base
use case and the child use case is connected at the base of the arrow.
The stereotype "<>" identifies as an extend relationship
Generalization
Student: Wants to borrow a book efficiently, with minimal wait time and receive a due date
remainder.
Librarian: Wants to issue book for users with accurate record – keeping to avoid disputes or
errors.
Library System: Ensures book are correctly entered into the students name, want to maintain
accurate inventory records, track borrowed books.
Fine: Concerned with ensuring fines for late returns or lost
Preconditions:
The book’s status is updated to “issued” in the library system. The borrowing record of the
student is updated. Book’s due date for return is set. The count of the book is adjusted in the
inventory.
Frequency of occurrence
Student does not renew books and not pay the fine.
Handling lost or damaged books during the borrowing period.