Class Diagram for the Online Stock Brokerage System

Learn to create a class diagram for a stock brokerage system using the bottom-up approach.

In this lesson, we'll identify and design the classes, abstract classes, and interfaces based on the requirements that we have previously gathered from the interviewer in an online stock brokerage system.

Components of a stock brokerage system

As mentioned earlier, we will design the online stock brokerage system using a bottom-up approach.

Account

Account is an abstract class that is used to store the account information of a person. This class has members like account ID, password, account status, address, email, and phone number. There can be two types of accounts, i.e., Admin and Member.

Member: They can search the stock, place an order to buy or sell stocks, create an account, start a membership, add stocks to the wishlist, add buying and selling limits, as well as perform transactions in many ways.

Admin: They can block or unblock members, and cancel their membership.

Press + to interact
The class diagram of Account and its derived classes
The class diagram of Account and its derived classes

Watchlist

A list of stocks that an investor keeps an eye on to profit from price drops is called a watchlist. The visual representation of the Watchlist class is provided below.

Press + to interact
The class diagram of the Watchlist class
The class diagram of the Watchlist class

Stock

A stock is also known as equity. It is a security that represents a portion of the issuing company's ownership. The Stock class will have a symbol, price, etc.

Press + to interact
The class diagram of the Stock class
The class diagram of the Stock class

Search and stock inventory

The StockInventory class will retrieve and keep up with the most recent stock values from the StockExchange class (defined later). The StockInventory class implements the Search interface.

Press + to interact
The class diagram of the Search interface and the StockInventory class
The class diagram of the Search interface and the StockInventory class

Stock position

All the stocks that the ...

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.