Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
27 views6 pages

Oomd Final

The document discusses object-oriented concepts like classes, objects, relationships, and modeling techniques. It provides examples of classes that could be used in a bowling scorekeeping application, and explains concepts like the class model, state model, interaction model, object-oriented development, and UML diagrams.

Uploaded by

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

Oomd Final

The document discusses object-oriented concepts like classes, objects, relationships, and modeling techniques. It provides examples of classes that could be used in a bowling scorekeeping application, and explains concepts like the class model, state model, interaction model, object-oriented development, and UML diagrams.

Uploaded by

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

Q1.

Prepare a list of classes that you would expect for a program to compute and store bowling
scores. for 10 marks

Certainly! Here's an expanded list of classes for a program to compute and store bowling scores,
along with a brief descrip on of each class:

1. **Player**: Represents a player par cipa ng in a bowling game. This class would store
informa on such as the player's name and their scores for each frame.

2. **Frame**: Represents a single frame in a game of bowling. It would track the number of pins
knocked down in each roll and calculate the score for the frame.

3. **Game**: Represents a complete game of bowling. It manages the game flow, including
advancing frames, tracking player turns, and enforcing game rules. It would also compute the final
score for each player.

4. **ScoreCalculator**: This class contains the main logic for calcula ng bowling scores. It would
analyze the frames and determine the score based on strikes, spares, and regular rolls. It may also
handle bonus rolls in the 10th frame.

5. **Scoreboard**: Represents the overall scoreboard for a bowling game. It would track and display
the scores for all players throughout the game.

6. **ScoreStorage**: Manages the storage and retrieval of bowling scores. It could use a database or
file system to persist the scores for later reference.

7. **PlayerManager**: Handles the management of players in a bowling game. It may include


methods for adding, removing, and retrieving player informa on.

8. **GameValidator**: Validates the integrity of the game state and ensures that all rules are
followed. It could check for errors such as invalid scores or illegal moves.

9. **UIController**: Handles the user interface for the bowling program. It interacts with the user,
displays the scoreboard, and accepts input for player names and scores.

10. **Main**: The main class of the program that ini ates the game, creates instances of other
classes, and orchestrates the overall execu on.
These classes work together to create a comprehensive program for compu ng and storing bowling
scores. The specific design and implementa on details may vary based on your requirements and
programming language.

Q2. Explain any 5 object oriented themes. Pg no 6,7

1.3.1 Abstrac on

1.3.2 Encapsula on

1.3.3 Combining Data and Behavior

1.3.4 Sharing

1.3.5 Emphasis on the Essence of an Object

Q3. Explain the three models used t model a system.

Pg no 16 17

Certainly! Let's delve into the explana ons of class models, state models, and interac on models for
system modeling:

1. **Class Model**:

A class model represents the structure and rela onships between the classes in a system. It focuses
on the sta c aspects of the system's design, describing the objects' characteris cs and their
associa ons. Key elements of a class model include:

- **Class**: A class is a blueprint for crea ng objects with similar a ributes and behaviors. It defines
the proper es (a ributes) and ac ons (methods) that objects of that class can have.

- **Associa on**: Associa ons represent rela onships between classes, indica ng how instances of
one class are connected to instances of other classes. Associa ons can be one-to-one, one-to-many,
or many-to-many.

- **Inheritance**: Inheritance depicts the "is-a" rela onship between classes, where one class
inherits proper es and behaviors from a parent or superclass. It promotes code reuse and allows for
specializa on of behavior.

- **Aggrega on and Composi on**: Aggrega on and composi on represent part-whole


rela onships between classes. Aggrega on represents a loosely coupled rela onship, while
composi on implies ownership, meaning the whole is responsible for the existence of its parts.
2. **State Model**:

A state model, o en represented using state diagrams or state machines, captures the different
states and transi ons that an object or system can undergo. It focuses on the dynamic behavior and
the lifecycle of objects. Key elements of a state model include:

- **State**: A state represents a condi on or situa on that an object or system can be in. It
describes the behavior and a ributes of the object during a specific phase of its existence.

- **Transi on**: Transi ons depict the movement of an object from one state to another triggered
by an event or condi on. They define the ac ons or ac vi es that occur during the state change.

- **Events**: Events are the s muli or triggers that cause a transi on from one state to another.
They can be internal (such as a method call) or external (such as a user interac on).

- **Ac ons**: Ac ons represent the opera ons or ac vi es that occur during a transi on. They
specify the behavior or computa ons that take place when an event triggers a state change.

3. **Interac on Model**:

An interac on model focuses on capturing the communica on and interac ons between system
components, objects, or processes. It emphasizes the flow of messages and the collabora on
between these en es. Key elements of an interac on model include:

- **Sequence Diagram**: A sequence diagram represents the chronological order of interac ons
between objects or components. It shows the messages exchanged and the order in which they
occur.

- **Communica on Diagram**: A communica on diagram, also known as a collabora on diagram,


depicts the structural organiza on of objects and the messages passed between them. It emphasizes
the rela onships and interac ons between objects.

- **Interac on Overview Diagram**: An interac on overview diagram provides an overview of


interac ons, combining elements from sequence and communica on diagrams. It shows the flow of
control and decision points between objects or components.
These modeling techniques—class models, state models, and interac on models—provide a
comprehensive approach to system modeling, covering the structural, behavioral, and dynamic
aspects of a system. They enable clearer understanding, be er design, and effec ve communica on
during the development process.

Q4. Illustrate an excerpt of a model for a financial applica on.

Pg no 27

Q5. Explain mul plicity with an example.

Pg no 29

Q6 Explain object oriented development with an example.

Object-oriented development (OOD) is a so ware development methodology that focuses on


crea ng modular, reusable, and maintainable so ware systems using the principles of object-
oriented programming (OOP). It emphasizes the organiza on of code around objects, which
encapsulate data and behavior. Let's explore object-oriented development with an example:

Consider a scenario where we are developing a simple banking system. We can apply object-oriented
development principles to design and implement this system.

1. **Iden fy Objects**: We start by iden fying the main objects in the system. In this case, we can
iden fy objects such as "Account," "Customer," and "Transac on."

2. **Define Classes**: Each object corresponds to a class that defines its structure and behavior. For
example, we can have classes like "Account," "Customer," and "Transac on." These classes will have
a ributes (data) and methods (behavior) associated with them.

- The "Account" class may have a ributes such as account number, balance, and account type. It
can also have methods like deposit, withdraw, and check balance.

- The "Customer" class may have a ributes such as customer ID, name, address, and contact
details. It can have methods like update address and display customer informa on.

- The "Transac on" class may have a ributes such as transac on ID, date, amount, and transac on
type. It can have methods like process transac on and display transac on details.

3. **Define Rela onships**: We define rela onships between classes to represent how objects
interact with each other. For instance, an "Account" may be associated with a "Customer" and can
have mul ple "Transac ons."
- The "Account" class can have a composi on rela onship with the "Customer" class, as an account
is owned by a customer. It can also have an associa on with the "Transac on" class, as it may have
mul ple transac ons associated with it.

4. **Implement Class Func onality**: We implement the methods and behaviors defined in each
class. For example, the "Account" class's deposit method would update the account balance, the
"Customer" class's update address method would modify the customer's address, and the
"Transac on" class's process transac on method would perform the necessary opera ons for a
transac on.

5. **Create Objects**: We create instances of the classes to represent individual objects. For
instance, we can create a "Customer" object for a specific customer, an "Account" object for their
bank account, and a "Transac on" object for each transac on.

6. **Interact with Objects**: We interact with the objects by invoking their methods and accessing
their a ributes. For example, we can deposit money into an account by calling the "deposit" method
on the "Account" object, or we can display customer informa on by calling the "display customer
informa on" method on the "Customer" object.

By following the object-oriented development approach, we can design and build a banking system
that is organized, modular, and extensible. The objects and classes provide a clear structure for
represen ng the en es and their behavior, promo ng code reuse and maintainability.

Q7. Same as q5.

Q8. Same as q4.

Q9.

Q10. 10 Explain ternary associa on and links with an example.

Pg no 65

Q11. Illustrate mul ple inheritance from disjoint classes and overlapping classes for employee
database.

Pg no 71,72

Q12. 12 Explain state diagram for a copy machine caused by event sequences.

Pg no 109

Q13. Illustrate nested states for a phone line.

Pg no 113
Q14. 14 Explain an aggrega on concurrency and concurrent state diagram with an example.

Pg no 116

Q15List out state diagram behaviors and explain any two with an example.

Pg no 99.

You might also like