{"id":28435703,"url":"https://github.com/piamacalanda/softeng2_solid-library-borrowing-system","last_synced_at":"2025-06-27T22:31:18.528Z","repository":{"id":287038917,"uuid":"963355874","full_name":"PiaMacalanda/SoftEng2_SOLID-Library-Borrowing-System","owner":"PiaMacalanda","description":"Basic Library Borrowing System that adheres to SOLID principles, particularly focusing on the Dependency Inversion Principle (DIP).","archived":false,"fork":false,"pushed_at":"2025-04-10T14:26:03.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T21:07:51.299Z","etag":null,"topics":["dependency-inversion-principle","solid-principles"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PiaMacalanda.png","metadata":{"files":{"readme":"README.md","changelog":"Newspaper.java","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-09T14:54:17.000Z","updated_at":"2025-04-10T14:26:07.000Z","dependencies_parsed_at":"2025-04-09T17:44:13.742Z","dependency_job_id":null,"html_url":"https://github.com/PiaMacalanda/SoftEng2_SOLID-Library-Borrowing-System","commit_stats":null,"previous_names":["piamacalanda/softeng2_solid-princip-library-borrowing-system","piamacalanda/softeng2_solid-library-borrowing-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PiaMacalanda/SoftEng2_SOLID-Library-Borrowing-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_SOLID-Library-Borrowing-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_SOLID-Library-Borrowing-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_SOLID-Library-Borrowing-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_SOLID-Library-Borrowing-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PiaMacalanda","download_url":"https://codeload.github.com/PiaMacalanda/SoftEng2_SOLID-Library-Borrowing-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PiaMacalanda%2FSoftEng2_SOLID-Library-Borrowing-System/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262343704,"owners_count":23296378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-inversion-principle","solid-principles"],"created_at":"2025-06-05T21:07:50.285Z","updated_at":"2025-06-27T22:31:18.512Z","avatar_url":"https://github.com/PiaMacalanda.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NEU Library Borrowing System\n\n### Problem Statement\n\nThe NEU Library offers a variety of resources, including books, theses, capstones, internet access, journals, and newspapers. Currently, the **Student** object has methods like **borrowBook()**, **borrowJournal()** with a parameter of title, which directly depend on specific resource types.\n\nTo adhere to the **Dependency Inversion Principle (DIP)** and ensure flexibility for future changes (such as introducing audio books or e-journals), we need to refactor the program while maintaining SOLID principles. The goal is to create a robust system that can seamlessly accommodate new resource types in the future.\n\n### UML Class Diagram\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://github.com/user-attachments/assets/99d252c7-9f0f-41fa-8356-9b2059350e9f\" height=\"500\" /\u003e\n\u003c/p\u003e\n\n### Solution Description\n\nThe solution implements the Dependency Inversion Principle by:\n\n1. Creating an abstraction (interface) called `LibraryResource` that different resource types implement\n2. Refactoring the `Student` class to depend on abstractions rather than concrete implementations\n3. Using the Strategy Pattern to handle different types of resources\n4. Ensuring all SOLID principles are maintained:\n   - **Single Responsibility Principle**: Each class has a single responsibility\n   - **Open/Closed Principle**: The system is open for extension but closed for modification\n   - **Liskov Substitution Principle**: All resource types can be used interchangeably\n   - **Interface Segregation Principle**: Interfaces are specific to clients' needs\n   - **Dependency Inversion Principle**: High-level modules depend on abstractions, not concrete implementations\n\n### How to Run💨🏃‍♀️‍➡️\n\nTo test the implementation, run the `TestProgram` class:\n\n```\njavac TestProgram.java\njava TestProgram\n```\n\n### File Structure\n\n```\n├── TestProgram.java\n└── library/\n    ├── LibraryResource.java\n    ├── Library.java\n    ├── LibraryFacade.java\n    ├── Student.java\n    └── resources/\n        ├── Book.java\n        ├── Journal.java\n        ├── Thesis.java\n        ├── Newspaper.java\n        └── AudioBook.java\n```\n\n\u003c!-- ## Future Extensions\n\nThe system is designed to easily accommodate new resource types:\n- Simply create a new class implementing the `LibraryResource` interface\n- No changes are needed to the `Student` class or other existing code --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiamacalanda%2Fsofteng2_solid-library-borrowing-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiamacalanda%2Fsofteng2_solid-library-borrowing-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiamacalanda%2Fsofteng2_solid-library-borrowing-system/lists"}