SynthCorp is a smart manufacturing system built in Java using OOP and design patterns. It simulates an automated factory with robots, real-time monitoring, inventory control, and safety features. Patterns like Singleton, Factory, Observer, Strategy, Facade, and State ensure scalability and efficiency.
In 2045, SynthCorp's advanced automation revolutionized manufacturing. However, after a critical software update, catastrophic failures led to:
- Malfunctioning robots (incorrect assembly, halts)
- Erratic raw material orders (overstocking/shortages)
- Machines ignoring safety protocols
- Unpredictable scheduling and shipment delays
Your OOP engineering team is tasked to restore and upgrade this control system using OOP and design patterns to ensure efficiency, scalability, and safety.
- Encapsulation: Securely manage machine data, inventory logs, and production schedules.
- Inheritance: Hierarchy of machines (e.g.,
AssemblyRobot,PackagingRobot,QualityControlBotfrom baseMachineclass). - Polymorphism: Multiple manufacturing strategies (Mass Production, Custom Batch, On-Demand).
- Abstraction: Simple manager-facing API for plant control & monitoring.
- Factory Pattern: Dynamically create machine types (
CuttingMachine,DrillingMachine,WeldingMachine). - Singleton Pattern: Central Control System as a single orchestrator.
- Builder Pattern: Custom production setups (assembly lines, quality rules).
- Facade Pattern: Unified dashboard for monitoring and control.
- Adapter Pattern: Integrate legacy hardware with new software.
- Decorator Pattern: Add features like error detection or energy-saving.
- Observer Pattern: Engineer notifications on faults/maintenance.
- Strategy Pattern: Switch production modes based on market/resource state.
- Command Pattern: Undoable production actions (pause/cancel orders).
- State Pattern: Machine status tracking (
Idle,Active,Error,Maintenance).
- Inventory & Resource Management: Auto-track/reorder raw materials.
- Safety Protocols: Emergency shutdown automation.
- Production Optimization: Dynamic scheduling to reduce downtime.
Synthcorp/
│
├── src/
│ └── main/
│ └── java/
│ └── com/
│ └── synthcorp/
│ ├── Main.java # Entry point
│ ├── controllers/
│ │ ├── CentralControlSystem.java # Singleton orchestrator
│ │ ├── DashboardFacade.java # Facade for manager interface
│ │ ├── ProductionStrategy.java # Strategy pattern interface
│ │ ├── CommandManager.java # Command pattern for production orders
│ ├── machines/
│ │ ├── Machine.java # Base class
│ │ ├── AssemblyRobot.java
│ │ ├── PackagingRobot.java
│ │ ├── QualityControlBot.java
│ │ ├── CuttingMachine.java
│ │ ├── DrillingMachine.java
│ │ ├── WeldingMachine.java
│ │ ├── LegacyMachineAdapter.java # Adapter pattern
│ │ ├── MachineDecorator.java # Decorator pattern
│ ├── observer/
│ │ ├── Observer.java # Observer interface
│ │ ├── EngineerNotifier.java # Observer concrete class
│ ├── builder/
│ │ ├── AssemblyLineBuilder.java # Builder pattern for setups
│ ├── state/
│ │ ├── MachineState.java # State pattern interface
│ │ ├── IdleState.java
│ │ ├── ActiveState.java
│ │ ├── MaintenanceState.java
│ │ ├── ErrorState.java
│ ├── inventory/
│ │ ├── InventoryManager.java # Inventory & resource control
│ ├── safety/
│ │ ├── SafetyProtocol.java # Safety systems
│ └── utils/
│ └── Logger.java # Logging utilities
│
├── src/
│ └── test/
│ └── java/
│ └── com/
│ └── synthcorp/
│ └── ... # Unit & integration tests
│
├── docs/
│ └── design.md # Architecture and design patterns used
│
├── pom.xml # Maven build config
├── README.md
└── LICENSE
-
Clone the repository:
git clone https://github.com/Jainam2204/Synthcorp.git cd Synthcorp -
Build the project using Maven:
mvn clean install
-
Run the application:
mvn exec:java -Dexec.mainClass="com.synthcorp.Main" -
Run tests:
mvn test
- See
docs/design.mdfor pattern explanations and architectural decisions. - In-code comments and JavaDoc provide further guidance.
Pull requests welcome! Please see CONTRIBUTING.md for guidelines.
SynthCorp project by Jainam2204 and OOP engineering team.