0% found this document useful (0 votes)
12 views20 pages

City Bookshop App: OOP Design & UML Guide

assignment about city book shop management system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views20 pages

City Bookshop App: OOP Design & UML Guide

assignment about city book shop management system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Introduction

The City Bookshop is a new retail bookshop which has been set up in the central business
district of the city with the objectives of offering a good variety of books and convenient
shopping facilities to the clients. In order to improve the efficiency of its work and optimise
the transactions performed the management has opted to incorporate a specific application
into the organization. This application is meant to perform some of the basic obligations to
help the bookshop function more efficiently in handling the stock and interacting with users.
The reason for automating the book inventories and customer transactions is due to the
complexities that come with the management of the books and customers.

The core objective of the application is to support two distinct user roles: These include
Cashier and Manager. Both roles have preassigned attributes that are appropriate to their
positions in the bookshop. They include the ability to view and search for book details since
they perform most of the transactions with customers and need to have this information at
their finger tips. While the Client has some authorities, which allow him to change the
registered data and delete or add books in the list of available ones, the Manager has more
rights, including the creation of new clients’ accounts. This division of responsibility is useful
in order to eliminate confusion as well as in order to make almost all the front line marketing
work and all the back end bureaucratic work.

The design of the application makes use of Object-Oriented Programming (OOP) in order to
achieve high reliability as well as its expandability. Encapsulation, inheritance, abstraction,
polymorphism are used in the system to make it modular and reusable and also easily
maintainable. Encapsulation provides for safe data management and called method relations
throughout the system. Inheritance offers one a manner of categorizing the user roles where
abstraction on the other hand makes complex features easily manageable. By this way,
polymorphism contributes to flexibility for given methods to behave differently depending on
the situation.

This document describes the City Bookshop application: its design and a general overview of
its implementation as well as the application of OOP concepts in this project are discussed in
this report In addition, this report contains the detailed user manual for the City Bookshop
application. The phase that precedes implementation is known as the design phase where use
case description is made, class and sequence diagram are used to show the structure of the
system and how it operates. These diagrams are crucial for visualizing how users interact
with the system and how various components collaborate to fulfill user requirements. The
user manual provides practical guidance for end-users, including Cashiers and Managers,
ensuring they can effectively navigate and utilize the application’s features.

The successful implementation of this application is expected to significantly enhance the


operational efficiency of the City Bookshop, reduce manual errors, and provide a more
efficient customer service experience. As the bookshop grows, this system will facilitate
better management of book inventory and user accounts, supporting the overall business
objectives and contributing to the long-term success of the establishment.

TASK 1

UML Diagrams

To design a solution for the City Bookshop's application using UML diagrams, I'll guide you
through the development of the required diagrams: Among them, the most relevant to the
case are Use case diagram, Class diagram and sequence diagram.

Assumptions:

1. The system is developed as desktop application.


2. While the Cashier is restricted like, viewing and searching book details the Manager
can also perform account and book details modification and updates.
3. The application communicates with a database to be able to archive data concerning
books as well as user accounts.

a) Use Case Diagram

In Use Case Diagram we get to know the flows or the transaction between the actors of the
system (The Cashier and the Manager).

Actors:

- Cashier: A user profile of an actor who can see general book details and search for
books.
- Manager: An actor with all the functionalities of the Cashier, plus create accounts and
books.
Use Cases:

- View Book Details: Both cashier and Manager can view all available details of a book.
- Search Stock Details: Cashier and Manager have the ability to look for the desired book
stock details by choosing a category, name or price.
- Create Account: Manager has the possibility to create new user accounts with diverse
account types.
- Add New Books: Manager can also extend the stock of books.
- Add New Category: It also enables Manager to input additional categories of books in
to the system.

Diagram Explanation:

- Cashier: In this role, interactions are with “View Book Details” and “Search Stock
Details” use cases.
- Manager: He is connected to all the use cases, and gains all the operations that are
provided to the Cashier user role.

b) Class Diagram

The Class Diagram is the first view of the system and represents the static aspect of the
system and portrays the classes, attributes, methods and objects of the system.
Classes:

- Book: These are the fields of the database; BookID, Title, Author, Category, Price as well
as StockQuantity. These comprises of `getBookDetails()` and `searchBook()`.
- Category: Two attributes are elements of this entity and they are; CategoryID and
CategoryName. These include; `addCategory()` This is used to add a new category or
subcategory `getCategoryDetails() This is used to get the details of a specific category or
subcategory.
- User: It has the following attributes namely UserID, Username, Password and Role.
Methods include ‘login()’ and ‘logout()’.
- Cashier: Subclass of User. No further characteristics or functions.
- Manager: Subclass of User. Other methods are createAccount() and addBook().

Diagram Explanation:

- Book and Category classes are associated since each book belongs to a category.
- User is a superclass, with Cashier and Manager as subclasses, reflecting their different
roles.

c) Sequence Diagram

The above figure depicts the Sequence Diagram where object in the system interacts for
particular use cases over time.

Use Case: Manager increases a new book

Objects:

- Manager
- Book
- Category
- Database

Sequence:

- The Manager is logged in setting into motion the login() method of the User object.
- The Manager chooses the option to add a new book on the window displayed on the user
interface.
- Every input, required by the system for book details is entered by the Manager.
- Here the category may exist or may not; to check the existence the system queries the
database using Category object.
- If the category exists, containing one or many books, the new book is included in the
object Book.

Here the new book information is then stored in the database of the current system.
Diagram Explanation:

Then we have the sequence that begins with the Manager’s action and presents the flow of
messages between objects as long as they have to add a new book.

Summary:

 Use Case Diagram: Demonstrates activities of actors and relations between them.
 Class Diagram: This describes the static view of the system in terms of classes, attributes,
methods and the relationships.
 Sequence Diagram: Illustrates the sequence of activities in the process for one
application scenario in the course of time.

Altogether these diagrams provide a clean and easily understandable design solution of City
Bookshop’s application.
TASK 2

To develop a suitable system for the City Bookshop scenario, you can implement the
application using Object-Oriented Programming (OOP) concepts. Below, I'll guide you
through the main functionalities, how OOP principles are applied, and provide sample code
snippets.

1. Class Design and Object Creation

Classes:

- Book: Represents books in the system.


- Category: Represents categories to which books belong.
- User: A base class representing a user (Cashier or Manager).
- Cashier: Inherits from User, representing a cashier in the system.
- Manager: Inherits from User, with additional responsibilities.

Objects:

- Instances of `Book`, `Category`, `Cashier`, and `Manager` represent real-world entities in


the system.

2. Encapsulation

Encapsulation ensures that the internal state of an object is hidden from the outside. Each
class will have private attributes, accessible only through public methods.

Example:

public class Book

private int BookID;

private string Title;

private string Author;

private string Category;

private decimal Price;


private int StockQuantity;

public Book(int bookID, string title, string author,


string category, decimal price, int stockQuantity)

this.BookID = bookID;

this.Title = title;

this.Author = author;

this.Category = category;

this.Price = price;

this.StockQuantity = stockQuantity;

public string GetBookDetails()

return $"{Title} by {Author} in {Category} category,


priced at {Price}.";

public void UpdateStock(int quantity)

StockQuantity += quantity;

}
3. Inheritance

Inheritance allows the `Cashier` and `Manager` classes to inherit common functionality from
the `User` class.

Example:

public class User

protected int UserID;

protected string Username;

protected string Password;

protected string Role;

public User(int userID, string username, string password,


string role)

this.UserID = userID;

this.Username = username;

this.Password = password;

this.Role = role;

public virtual void Login()

Console.WriteLine($"{Username} logged in as {Role}.");

}
}

public class Cashier : User

public Cashier(int userID, string username, string


password)

: base(userID, username, password, "Cashier") {}

public void SearchBook(string searchParameter)

// Implement search logic here

public class Manager : Cashier

public Manager(int userID, string username, string


password)

: base(userID, username, password) {}

public void CreateAccount(User newUser)

// Implement account creation logic here

}
public void AddBook(Book newBook)

// Implement book addition logic here

4. Abstraction

Abstraction is used to hide complex implementation details and expose only the necessary
functionality.

Example:

The `User` class abstracts the common functionalities for `Cashier` and `Manager`, while the
`Manager` class abstracts additional responsibilities like creating accounts and adding books.

5. Polymorphism

Polymorphism allows methods to be overridden to provide different behaviors in derived


classes.

Example:

public class User

public virtual void PerformDuties()

Console.WriteLine("User duties performed.");

}
public class Cashier : User

public override void PerformDuties()

Console.WriteLine("Cashier duties performed: Viewing


and searching books.");

public class Manager : Cashier

public override void PerformDuties()

Console.WriteLine("Manager duties performed: Managing


accounts and inventory.");

}
Summary:

This implementation demonstrates the use of OOP concepts such as classes, objects,
encapsulation, inheritance, abstraction, and polymorphism in the context of a bookshop
management system. The provided code snippets are simplified to focus on the core concepts
and can be expanded upon as needed for a full implementation.

TASK 3

User Manual
User Manual for City Bookshop Application

Version: 1.0
Developed by: NAME

Table of Contents

1. Introduction

2. System Requirements

3. Installation Guide

4. User Roles and Functionalities

o Cashier

o Manager

5. How to Use the Application

o Login Process

o Viewing Book Details

o Searching for Books

o Adding New Books (Manager Only)

o Creating a New Account (Manager Only)

6. Troubleshooting

7. FAQs

8. Contact Information

1. Introduction

The City Bookshop Application is designed to automate the transaction process of bookshops,
allowing users to efficiently manage book inventory and user accounts. The system supports two user
roles: Cashier and Manager, each with specific functionalities tailored to their job responsibilities.

2. System Requirements

 Operating System: Windows 7 or later

 RAM: Minimum 4 GB
 Hard Disk: Minimum 100 MB free space

3. Installation Guide

1. Download the Application:

o Obtain the installation file from the official source or developer.

2. Run the Installer:

o Double-click the installer file and follow the on-screen instructions.

3. Complete Installation:

o Choose the installation directory and complete the setup. Ensure that all
components are installed properly.

4. Launch the Application:

o After installation, you can launch the application from the Start Menu or desktop
shortcut.

4. User Roles and Functionalities

Cashier

 View Book Details: Access all available book information.

 Search for Books: Look up books based on title, category, price, etc.

Manager

 View Book Details: Access all available book information.

 Search for Books: Look up books based on title, category, price, etc.

 Add New Books: Add new books to the inventory.

 Create New Account: Create new user accounts for Cashiers or Managers.

5. How to Use the Application

Login Process

1. Launch the Application:

o Open the application from the Start Menu or desktop shortcut.

2. Enter Credentials:

o Input your username and password.

o Click enter

3. Access Granted:
Viewing Book Details

1. Navigate to the Book Section:

o From the main menu, select "View Books."

2. Browse Books:

o All available books will be listed with details like title, author, category, and price.

3. Select a Book:

o Click on a book to view more detailed information.

Searching for Books

1. Search Function:

o Go to the "Search Books" section.

2. Enter Search Criteria:

o Input the title, category, or price range in the search fields.

3. View Results:

o The application will display matching results.

Adding New Books (Manager Only)

1. Access the Add Book Section:

o Managers can navigate to the "Add New Book" option.

2. Input Book Details:

o Enter the title, author, category, price, and stock quantity.

3. Save the Book:

o Click "Add Book" to save the new entry to the inventory.

Creating a New Account (Manager Only)

1. Navigate to Account Management:

o Select "Create New Account" from the Manager's menu.

2. Enter User Details:

o Input the username, password, and role (Cashier or Manager).

3. Save the Account:

o Click "Create Account" to finalize the creation of the new user account.
6. Troubleshooting

 Login Issues:

o Ensure the correct username and password are entered. If the problem persists,
contact the system administrator.

 Book Search Not Returning Results:

o Check if the correct search criteria were entered. Try broadening your search
parameters.

 Unable to Add New Books:

o Verify that all required fields are filled out correctly. Only Managers have the
permission to add books.

7. FAQs

Q: Can I change my password?


A: Currently, password change functionality is not implemented. Contact the system
administrator for help.

Q: What should I do if I forget my login credentials?


A: Contact the system administrator to reset your credentials.

Q: How do I update book information?


A: Managers can modify book details by selecting the book and editing the fields.

8. Contact Information

For further assistance, please contact the City Bookshop IT support team:

 Email: [email protected]

 Phone: +1-800-555-BOOK (2665)

 Office Hours: Monday to Friday, 9:00 AM - 5:00 PM

Conclusion
Finally, one can conclude that the use of the City Bookshop application for the bookshop’s
management is a great step forward in the transition to more efficient work. Using principles
of OO programming the application maintains high levels its efficiency, flexibility as well as
its maintainability. The application of the UML diagrams during the design phase has proven
effective as a reference of the system’s function and interaction Basin the different phases of
the development process thus putting the development of software in order.

Principal users of this application are a Cashier and a Manager, and both positions have their
functions tailored to their tasks. Through the organization of the data, cashiers have it easy
when it comes to viewing or searching book details hence increasing their efficiency when it
comes to attending to customers. Thus, there is the necessity to provide managers, with their
augmented functions, the possibilities for accounting and controlling user accounts, as well as
book stock, which will keep the operations of the bookshop smooth and suitable to the
existing needs.

OOP concepts have been used in the creation of this system, which is functional as well as
scalable and flexible as well. Encapsulation guarantees that the data is not modified or
corrupted while inheritance makes it easy to control the user abilities. The abstraction
technique simplifies the manipulation of an environment because it only offers a black box
interface through which the users will engage the system’s sub components, whereas
polymorphism allows a component to recognize several manifestations relying on context.

The user manual acts as a crucial reference tool for the end-users, to enable them understand
the functionalities of the application to allow them to harness the capacities of the system in
question. In itself, the manual helps users perform work on the application by following
elaborative step-by-step instructions and subsequent solutions to any complications.

All in all the use of City Bookshop application is expectable to boost the real-life
effectiveness of the bookshop by providing the better services to the clients and inflating the
shop’s capabilities. From the above discussions, it is clear that there are definite and tangible
advantages that implemented could in this system; less time consuming and error prone
manual work, more structured modality to work on inventories or users and so on. Lastly, as
the bookshop continues to grow, the application will be of importance in the overall running
and growth of the bookshop as it will be able to accomplish the objective of effectively
competing with other players o the book retail industry.
References

Booch, G., Rumbaugh, J. and Jacobson, I., 1999. The Unified Modeling Language User
Guide. 1st ed. Reading, MA: Addison-Wesley.

Fowler, M., 2004. UML Distilled: A Brief Guide to the Standard Object Modeling Language.
3rd ed. Boston, MA: Addison-Wesley.

Gamma, E., Helm, R., Johnson, R. and Vlissides, J., 1994. Design Patterns: Elements of
Reusable Object-Oriented Software. Reading, MA: Addison-Wesley.

Pressman, R.S., 2014. Software Engineering: A Practitioner's Approach. 8th ed. New York:
McGraw-Hill.

Sommerville, I., 2011. Software Engineering. 9th ed. Boston, MA: Addison-Wesley.

Larman, C., 2004. Applying UML and Patterns: An Introduction to Object-Oriented Analysis
and Design and Iterative Development. 3rd ed. Upper Saddle River, NJ: Prentice Hall.

Coad, P., Yourdon, E., 1991. Object-Oriented Analysis. 2nd ed. Englewood Cliffs, NJ:
Prentice Hall.

IEEE, 1990. IEEE Std 830-1998: IEEE Recommended Practice for Software Requirements
Specifications. New York: IEEE.

Myers, G.J., 2011. The Art of Software Testing. 3rd ed. Hoboken, NJ: Wiley.
McConnell, S., 2004. Code Complete: A Practical Handbook of Software Construction. 2nd
ed. Redmond, WA: Microsoft Press.

Sommerville, I., 2015. Software Engineering. 10th ed. Boston, MA: Addison-Wesley.

Rumbaugh, J., Jacobson, I. and Booch, G., 2005. The Unified Modeling Language Reference
Manual. 2nd ed. Boston, MA: Addison-Wesley.

Jacobson, I., Booch, G. and Rumbaugh, J., 1999. The Unified Software Development
Process. Reading, MA: Addison-Wesley.

Pressman, R.S., 2014. Software Engineering: A Practitioner's Approach. 8th ed. New York:
McGraw-Hill.

Bittner, K. and Spence, I., 2003. Use Case Modeling. Boston, MA: Addison-Wesley.

You might also like