The Library Management System (LMS) is a project designed to manage library operations such as adding books, registering members, borrowing books, and returning books. This project demonstrates the use of Object-Oriented Programming (OOP) concepts to model real-world entities and their interactions.
- Classes like
Book
,Member
, andLibrary
encapsulate their data (fields) and provide methods to interact with them. - Access modifiers (
private
,public
,protected
) are used to restrict direct access to class members, ensuring data integrity.
- The project hides implementation details and exposes only the necessary functionalities through methods like:
AddBook()
RemoveMember()
LendBook()
- This simplifies the interaction with complex operations.
- A
PremiumMember
class inherits from theMember
class to have additional features like extended borrowing limits. - Further extensions can be added using inheritance. For example:
- A
DigitalBook
class can inherit from theBook
class to add properties likefileSize
orformat
.
- A
- Polymorphism is demonstrated through method overriding.
- A method
BorrowBook()
is overridden in derived classPremium Member
to borrow a book upto higher limits than a normalMember
class.
- A method
- It can be demonstrated though method overloading as well. For example:
- Methods like
DisplayBookDetails()
are overloaded inBook
class to display specific details of books.
- Methods like
- The project defines multiple classes (
Book
,Member
,Library
, etc.) to represent real-world entities. - Objects of these classes are created to perform operations like borrowing books or registering members.
- Static members are used to store global data. For example:
- A static counter
nextId
in theBook
class to generate unique IDs for each book. - A static counter
nextId
in theMember
class to generate unique IDs for each member.
- A static counter
- Association: The
Library
class maintains a list ofBook
andMember
objects. - Aggregation: The
Member
class contains a list of borrowedBook
objects. - Composition: The
LibraryManager
class usesLibrary
objects as its own part. It cannot exist without aLibrary
class.- Similarly,
BooksManager
andMembersManager
classes depend onBook
andMember
objects respectively to manage specific functionalities.
- Similarly,
- Basic error handling is implemented using conditional checks. For example:
- Checking if a book is available before lending it.
- Ensuring a member exists before performing operations.
- Responsibilities are divided into different classes:
BooksManager
handles book-related operations.MembersManager
handles member-related operations.LibraryManager
coordinates overall library operations.
- Methods like
DisplayBookDetails()
andDisplayMemberDetails()
are reusable across different parts of the application, reducing redundancy.
- Add, update, and delete books.
- Register and manage library members.
- Borrow and return books.
- View details of books and members.
- Clone the repository:
git clone https://github.com/vrushalird/LMS-Library-Management-System.git
- Run the solution from terminal:
dotnet run