Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/camilo6castell/library-management-system

[EN][please see the README.md] Este proyecto hecho en Java para la administración de usuarios y textos, implementa el paradigma de programación orientada a objetos, patrones de diseño y testing.
https://github.com/camilo6castell/library-management-system

java junit mockito patterns-design poo

Last synced: about 22 hours ago
JSON representation

[EN][please see the README.md] Este proyecto hecho en Java para la administración de usuarios y textos, implementa el paradigma de programación orientada a objetos, patrones de diseño y testing.

Awesome Lists containing this project

README

        

# Library Management System

![Java](https://img.shields.io/badge/Java-007396?style=for-the-badge&logo=java&logoColor=white)
![Maven](https://img.shields.io/badge/Maven-C71A36?style=for-the-badge&logo=apachemaven&logoColor=white)
![JUnit](https://img.shields.io/badge/JUnit-25A162?style=for-the-badge&logo=junit5&logoColor=white)
![Mockito](https://img.shields.io/badge/Mockito-DB7093?style=for-the-badge&logo=mockito&logoColor=white)

## About

**Library Management System** is a console-based project developed in Java for the administration of a library, including users and texts.

This project utilizes various design patterns and includes unit tests to ensure functionality and reliability. It is built using Maven for dependency management and Mockito for mocking in unit tests.

## Features

1. **User Management**: Add, update, and delete library users.
2. **Text Management**: Add, update, and delete books and novels.
3. **Design Patterns**: Implementation of Prototype and Command design patterns.
4. **Unit Testing**: Comprehensive unit tests for various use cases.

## Installation

To run this project locally, follow these steps:

1. **Clone the repository:**
```bash
git clone https://github.com/camilo6castell/library-manager.git
cd library-manager
```

2. **Install dependencies:**
```bash
mvn clean install
```

3. **Run the application:**
```bash
mvn exec:java -Dexec.mainClass="src.Main"
```

## Design Patterns

### Prototype Pattern

The Prototype pattern is used to create copies of existing objects. It is implemented in the following files:

- **Objects with the `clone` method:**
```plaintext
src/main/java/src/models/texts/Book.java
src/main/java/src/models/texts/Novel.java
```

- **Implementation:**
```plaintext
src/main/java/src/usecases/book/UpdateBookUseCase.java
src/main/java/src/usecases/novel/UpdateNovelUseCase.java
```

### Command Pattern

The Command pattern is used to encapsulate all information needed to perform an action or trigger an event. It is implemented in the following files:

- **Command Interface:**
```plaintext
src/main/java/src/usecases/ui/menu/command/Command.java
```

- **Invoker:**
```plaintext
src/main/java/src/usecases/ui/menu/command/Invoker.java
```

- **Commands:**
```plaintext
src/main/java/src/usecases/ui/menu/command/AdministratorCommand.java
src/main/java/src/usecases/ui/menu/command/AssistantCommand.java
src/main/java/src/usecases/ui/menu/command/ReaderCommand.java
```

- **Implementation:**
```plaintext
src/main/java/src/usecases/ui/menu/ShowLogInMenuUseCase.java
```

## Unit Tests

Unit tests are located in the following directory:
```plaintext
src/test/java/usecases*
```

## Contact

Feel free to reach out to me through any of the following platforms:

- [LinkedIn](https://www.linkedin.com/in/camilocastell/)
- [GitHub](https://github.com/camilo6castell)

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.