A Smart Garden Simulation System designed using Object-Oriented Analysis & Design (OOAD) principles to model, monitor, and control garden components such as plants, sensors, irrigation, and environmental conditions through a modular and extensible architecture.
- Open the project in IntelliJ IDEA / Eclipse
- Run the Main Simulation Controller
- Configure garden parameters (plants, sensors, watering rules)
- Observe real-time garden behavior simulation
- Object-oriented modeling of garden entities (plants, sensors, irrigation controllers)
- Rule-based irrigation logic driven by environmental conditions
- Modular and extensible system architecture
- Clear separation of responsibilities using OOAD principles
- Simulation-driven execution without physical hardware dependency
User / Simulation Controller
|
v
Garden Manager
|
-------------------
| | |
Plant Sensor Irrigation
Models System Controller
| | |
Environment State & Rules Engine
- Acts as the central coordinator of the system
- Manages lifecycle of plants, sensors, and irrigation components
- Applies business rules and advances simulation steps
- Simulates environmental sensors (soil moisture, temperature, humidity)
- Feeds real-time environmental data into the system
- Designed for easy extension with new sensor types
- Decides watering actions based on sensor readings
- Implements strategy-based decision logic
- Prevents overwatering and optimizes resource usage
- Encapsulate plant-specific attributes and behavior
- React dynamically to environmental conditions
- Follow strict encapsulation and abstraction principles
| Pattern | Where Used | Purpose |
|---|---|---|
| Singleton | Garden Manager | Ensures a single coordination point for the simulation |
| Strategy | Irrigation Controller | Enables flexible watering decision algorithms |
| Observer | Sensor System → Controllers | Propagates environmental updates reactively |
| Factory | Plant / Sensor creation | Decouples object creation from business logic |
- SRP – Each class has a single, well-defined responsibility
- OCP – New plant or sensor types can be added without modifying existing logic
- DIP – Controllers depend on abstractions, not concrete implementations
- Clear separation between domain models, control logic, and simulation flow
- GUI dashboard using JavaFX or web frontend
- Integration with real IoT sensors
- Persistence layer for historical data
- Automated testing for simulation scenarios