A Java-based console simulation of a smart home system with event-driven interactions, device state management, user activities, and resource consumption tracking.
This project demonstrates object-oriented design, system modeling, and the practical use of multiple design patterns in a larger simulation-based application.
SmartHome Simulation models a household environment consisting of floors, rooms, users, and smart devices.
The system simulates interactions between users and devices, tracks energy and utility consumption, generates reports, and processes system events.
The project focuses on:
- object-oriented design
- system modeling
- design patterns
- event-driven architecture
- state management
- reporting and consumption tracking
- Smart home structure with floors, rooms, devices, and users
- Device interaction based on room context
- User activity simulation
- Device state transitions
- Centralized event handling
- Consumption tracking for electricity, water, and other resources
- Generated reports for activity, configuration, and usage
- Use of multiple design patterns in a single system
The application is built around a hierarchical object model:
- House
- contains multiple Floors
- each floor contains multiple Rooms
- rooms contain Devices
- users move through rooms and interact with available devices
This structure enables contextual device usage and simulation of real household behavior.
The project demonstrates several design patterns:
- Singleton – centralized system components such as event management
- Observer – event listeners subscribe to and react to system events
- State – devices and users change behavior depending on their current state
- Visitor – reporting logic traverses the smart home structure
- Iterator – custom iterators simplify traversal of devices and users
- Factory – device creation is encapsulated in a dedicated factory
- Builder – smart home configuration is assembled in a structured way
In addition, the project uses Stream API for filtering and aggregation tasks.
A central event subsystem is responsible for processing and distributing events across the simulation.
Key components include:
- EventManager – manages subscribers, dispatches events, and stores event history
- EventPool – reuses event objects to reduce unnecessary allocations
- EventSource – interface for components that produce events
This makes the simulation more modular and easier to extend.
The simulation generates reports related to:
- smart home configuration
- user activity
- device usage
- resource consumption
- system events
Reporting is one of the core parts of the project and demonstrates traversal and aggregation over the object model.
- Java
- Gradle
- Log4j2
- Object-Oriented Programming
- Java Stream API
Make sure you have installed:
- Java 17 or newer
- Gradle (optional if using the wrapper)
./gradlew clean build./gradlew run

