A robust implementation of the layered architecture pattern for standalone Java applications. This framework demonstrates clean separation of concerns through well-defined service layers, data access patterns, and business logic organization. Built with Java 17+ and Maven, it provides a solid foundation for building maintainable Java applications.
| Feature | Description |
|---|---|
| 🏗️ Three-tier Architecture | Clear separation between service, business, and data layers |
| 📦 Modular Design | Discrete Maven modules for better maintenance |
| 🧪 Comprehensive Testing | Unit and integration tests with JUnit 5 |
| 🛠️ Build Automation | Maven-based build lifecycle management |
graph TD
A[View Layer] --> B[Controller Layer]
B --> C[Model Layer]
C --> D[(Database)]
style A fill:#ff9900,stroke:#333,stroke-width:2px
style B fill:#00b8d4,stroke:#333,stroke-width:2px
style C fill:#00c853,stroke:#333,stroke-width:2px
style D fill:#7e57c2,stroke:#333,stroke-width:2px
| Technology | Version | Purpose |
|---|---|---|
| Java | 17+ | Core Programming Language |
| Maven | 3.9.6 | Build and Dependency Management |
| JUnit | 5.9.2 | Testing Framework |
| Mockito | 5.10.0 | Mocking Framework |
| H2 Database | 2.2.224 | Development Database |
| PostgreSQL | 15+ | Production Database |
| Hibernate | 6.2+ | ORM Framework |
src/
├── main/
│ ├── java/
│ │ ├── view/ # View components and UI logic
│ │ ├── controller/ # Controllers handling user input
│ │ ├── model/ # Domain models and data access
│ │ └── config/ # Application configuration
│ └── resources/
│ ├── config/ # Configuration files
│ └── db/ # Database migration scripts
└── test/
└── java/ # Unit and integration tests
- Java 17 JDK
- Maven 3.9+
- PostgreSQL 15+ (for production)
# Clone the repository
git clone https://github.com/ChamathDilshanC/Layer_Architecture_Final.git
# Navigate to project directory
cd Layer_Architecture_Final
# Build the project
mvn clean install
# Run the application
java -jar target/layer-architecture.jar-
Layered Architecture
- Clear separation between service, business, and data access layers
- Dependency injection for loose coupling
- Interface-based design for flexibility
-
Data Access Layer
- JPA/Hibernate implementation
- Connection pooling
- Transaction management
- Entity lifecycle management
-
Business Layer
- Domain-driven design principles
- Business logic encapsulation
- Validation and business rules
-
Testing
- Unit tests with JUnit 5
- Integration tests
- Mockito for mocking dependencies
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Chamath Dilshan
⭐ Star this repository if you find it helpful!