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

Online Book Store System

The document discusses the benefits of studying design patterns. Some key benefits include: 1) Design patterns provide tangible, tried-and-true solutions that help analyze a program's abstract components. 2) They provide a clearer perspective on code implementation which speeds up development. 3) Design patterns promote code reuse and flexibility through mechanisms like delegation. 4) Following well-known design patterns makes code more readable and maintainable. 5) Programmers gain a common vocabulary and understanding of solutions through design patterns.

Uploaded by

Khizra
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)
71 views6 pages

Online Book Store System

The document discusses the benefits of studying design patterns. Some key benefits include: 1) Design patterns provide tangible, tried-and-true solutions that help analyze a program's abstract components. 2) They provide a clearer perspective on code implementation which speeds up development. 3) Design patterns promote code reuse and flexibility through mechanisms like delegation. 4) Following well-known design patterns makes code more readable and maintainable. 5) Programmers gain a common vocabulary and understanding of solutions through design patterns.

Uploaded by

Khizra
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

QUESTION#01:

Discuss the benefits of studying design patterns.

Answer:
Design patterns:
A design pattern is an all-encompassing, reusable solution to a frequently occurring problem
in a specific context in software engineering. It is not a finished design that can be turned into
source code or machine code right away. Creational, structural, and behavioral design patterns
are the three basic classifications used to group design patterns. These are distinct from one
another based on the degree of complexity, level of detail, and scope of application to the
overall system under design.
Why should we study design patterns?
A collection of tried-and-true answers to typical issues in software design is known as a design
pattern. Knowing patterns is helpful even if you never run into these issues since it teaches you
how to approach any issue using object-oriented design principles. Because they provide visual
hints to an underlying order, patterns are significant. Unlocking a pattern gives you the power
to change or mould it to produce a desired result. Patterns can also be used as a guide to rapidly
assess a situation and comprehend how it functions.
Benefits of studying design patterns:
Following are given some benefits of studying the design patterns:

• By offering tangible, tried-and-true solutions, design patterns help in the analysis of a


program's more abstract components.

• Design patterns provide you a clearer perspective of how you are implementing the design,
which speeds up the writing of code.

• By providing tried-and-true mechanisms for delegation and other non-inheritance-based


reuse techniques, design patterns promote code reuse and accommodate change.

• By following well-known paths, design patterns enable more readable and maintainable
programming.

• Programmers have a growing vocabulary and common language thanks to design patterns.
QUESTION#02:

In Assignment 4 (A4), a class diagram was derived according to the provided sequence
diagram, In A3, a sequence diagram was constructed for the “Remove Book” use case.
Use your “Remove Book” sequence diagram to update the class diagram that you had
finished in A4.

Answer:
The following response has been produced in a straightforward, step-by-step way.
Step: 1
A graphic representation of an object-oriented program is a class diagram.
This is a set of instructions for making one or more things.
Explanation:
There are three partitions in the class diagram. The class name is defined in the first division.
After the colon in the second partition, characteristics and data type are displayed. The third
section displays the method names, followed by the return type.
Step: 2
the class diagram from the sequence diagram is as follows.

Figure 1.1 Class Diagram

Explanation:
• This class diagram has 4 classes, including interface, library, book, and catalogue.
• In the interface class, the variables bookid and result are of the int type, and the method
removebook() has no return type.
• In the library class, the variables namehold and search are of the int type, and the method
getborrower() has no return type.
• Name and publisher are string type variables in the book class. Getname() and
getpublisher() are methods with no return type.
• In the catalogue class, the variable noofbooks is of type int, and the methods inputbook()
and printbook() have no return type.
A system’s class diagram, which defines the 3 partitions, is a visual representation of the
system. A class's name is defined in the first partition, its attributes' data types in the second,
and its method name and return type in the third. Direct, reflexive, multiple, and other
connecting lines are used to define relationships between classes.

QUESTION#03:

Illustrated in the video clip of “ModifyAmount.mp4 (and documented in the attached


casual description) is a feature of the online bookstore system that allows the user to
modify the amount of an order item if the new quantity is within the number of book
copies on stock. Go through the unified process to update the class diagram you finished
in A5.2 for this new use case. In the process, the OOA artifacts need to include a fully
dressed use case and a system sequence diagram, and the OOD artifacts include a
sequence diagram before updating the existing class diagram.

Answer: The feature of the online bookshop system that enables the user to adjust the
amount of an order if new quantity is within the number of books on stock is described in the
fully dressed use case below.
Use Case Name Modify Amount
Scope Online Bookstore System
Use Case Description: User shall be able to modify the amount of the order item if the
new quantity added within the number of the book stock.
Primary Actor: Customer
Pre-condition: User logged into the system using correct password.
Post-condition: User successfully modify the amount of the order item.
Main Success 1. User clicks on the book category to search the book.
Scenario: 2. System displays the books details using library and display
in the catalog.
3. User clicks on the book from the catalog.
4. User clicks on Add Book.
5. System added the book in the Order Book.
6. User selects the order Book and click on the Modify
Amount.
7. System displays the modify amount pop up window.
8. User adds the new amount.
9. System checks the stock.
10. System stores the new order amount.
Exception Condition: If the stock is not available for the book that the user wants to
modify the amount of the item, then the system displays the error
message.

Alternative Flow: 8a. User selects the in-stock number as the new amount.
8b. User cancel the modification.

Open Issues: If the site is down, then the modification will be done using the
system not the web.

Now the sequence diagram of the above use case description is given below:

Figure 1.2. Modify Amount Sequence Diagram

Following is given the class diagram using the above use case and the sequence diagram of
the feature Modify amount item:
Figure 1.2. Modify Amount Class Diagram

QUESTION#04
There are different types of users for the online bookstore system, including guest users,
club members, salespersons, and managers. Discuss how the maintainability of the system
can be improved by using a design pattern to deal with the variety of users.

Answer:
Design patterns are effective solutions that may be applied to situations that come up
repeatedly. Patterns are another name for templates that are employed to address certain issues.
There are many advantages to using design patterns, including:
Proven Solutions: That have been tested: Because patterns make use of tried-and-true
methods, they offer a good way to address issues that arise in software development.
Reusability: It is a pattern's key characteristic and what makes it robust.
Expression: Patterns make it relatively simple to express complex solutions.
Using design patterns might increase the system's maintainability due to the attributes
mentioned above. Furthermore, in the present scenario, where there are various user types,
patterns play a crucial role in resolving major issues, and expressiveness features or patterns
also play a crucial function. All the design pattern aspects are incredibly helpful during
maintenance and using traits like reusability makes maintenance much simpler.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy