Sie sind auf Seite 1von 6

Roll no 14

Jasjeet singh anand

PART-A

Q1.Develop an OO model for an e-bookstore. The core requirements


of the e-bookstore are to allow its customers to browse and order
books, music CDs, and computer software through the Internet. The
main functionalities of the system are to provide information about
the titles it carries to help customers make purchasing decisions;
handle customer registration, order processing, and shipping; and
support management of the system, such as adding, deleting, and
updating titles and customer information.

1. Identify classes. Classes can represent physical objects, people,


organizations places, events, or concepts. Class names should be
noun phrases.

2. Identify relevant fields and methods of the classes. Actions are


modeled as the methods of classes. Method names should be verb
phrases.

3. Identify any inheritance relationships among the classes and draw the
class diagram representing inheritance relationships.

4. Identify any association relationships among the classes and draw the
class diagram representing association relationships.

5. Identify any aggregation and composition relationships among the


classes and draw the class diagram representing dependency
relationships.

Ans

Classes:

 Subscription

 Stock

 Shipping

 Customer
 Music

 Books

 Subscription

 Create_account();

 Update_Info();

 Delete_Account();

 Stock

 Add();

 Update();

 Search();

 Delete();

 Shipping

 Verify();

 Deliver();

 Confirmation();

 Customer

 Enquire();

 Purchase();

 Pay();

 Music

 Artist();

 Search_Music();

 Review();

 Play();
 Pause();

 Books

 Title();

 Stock_Amount();

 Add();;

 Update();

 Deliver();

PART-B

Q2.Differentiate between the terms Generalization and


Specialization. Explain with an exam the close association between
Generalization and Inheritance

Ans

Specialization is the process of defining a set of subclasses of a


superclass .The set of subclasses is based upon some distinguishing
characteristics of the entities in the superclass

Generalization is the reverse of the specialization process .Several classes


with common features are generalized into a superclass; original classes
become its subclasses.

Example: CAR, TRUCK generalized into VEHICLE; both CAR, TRUCK become
subclasses of the superclass VEHICLE.We can view {CAR, TRUCK} as a
specialization of VEHICLE .Alternatively, we can view VEHICLE as a
generalization of CAR and TRUCK.

key difference
1. Generalization is the result of computing the union of two or more
entity sets to produce a higher-level entity set. It represents the
containment relationship that exists between the higher-level entity
set and one or more lower-level entity sets.while Specialization
constructs the lower level entity sets that are a subset of a higher level
entity set.
2. Arrow pointing to the generalized superclass represents a
generalization while Arrows pointing to the specialized subclasses
represent a specialization.
3. We do not use this notation because it is often subjective as to which
process is more appropriate for a particular situation while in
specialization We advocate not drawing any arrows in these situations

Q:-3 What is association? Differentiate between 1-way and 2-way


association with example for each.

Ans

Association is a relationship between two classifiers, such as classes or use


cases, that describes the reasons for the relationship and the rules that
govern the relationship.

An association represents a structural relationship that connects two


classifiers. Like attributes, associations record the properties of classifiers.
For example, in relationships between classes, you can use associations to
show the design decisions that you made about classes in your application
that contain data, and to show which of those classes need to share data.

Differentiate between 1-way and 2-way association

An association from one class to another is said to be navigable. One way


association goes from one class to another, while two-way association goes
in both directions.associations are usually shown with a line between the
classes. If the association is one-way then the will be an open arrow at the
class that the association is navigable to.If the association is two-way there
are no arrows. In a two-way navigable association there will be names on
both ends.

One-way association with example


The association between a book and its writer is, in this example, a single
one-way reference. The reference (role) name used to access the Writer from
a Book is author.

Two-way association with example

A association between objects can be bi-directional as well.Two-way


association: an author may have written 0 or more books, but a book can
only have one author.The association is now two-way, as indicated by the
lack of an arrowhead on the Writer end of the association line. The role name
used to access Books from a Writer is books.

Q 4: Write a short note on Structural and Behavioral diagrams. What


are the constituent diagrams of these two broad categories?

Ans

There are two broad caetgories of diagrams and then are again divided into
sub-categories:

• Structural Diagrams
• Behavioral Diagrams

Structural Diagrams:
The structural diagrams represent the static aspect of the system. These
static aspects represent those parts of a diagram which forms the main
structure and therefore stable.

Structural Diagrams

• Class Diagram – set of classes and their relationships. Describes interface


to the class (set of operations describing services)

• Object Diagram – set of objects (class instances) and their relationships.

• Component Diagram – logical groupings of elements and their


relationships.

• Deployment Diagram - set of computational resources (nodes) that host


each component.

Behavioral Diagrams:

Any system can have two aspects, static and dynamic. So a model is
considered as complete when both the aspects are covered fully.Behavioral
diagrams basically capture the dynamic aspect of a system. Dynamic aspect
can be further described as the changing/moving parts of a system

• Use Case Diagram – high-level behaviors of the system, user goals,


external entities: actors.

• Sequence Diagram – focus on time ordering of messages.

• Collaboration Diagram – focus on structural organization of objects and


messages.

• State Chart Diagram – event driven state changes of system.

• Activity Diagram – flow of control between activities.

Das könnte Ihnen auch gefallen