Skip to content

qucat/gui-circuit-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Structure explanation

src/
├── domain/                     # Core business logic
│   ├── aggregates/             # Aggregate roots
│   │   └── Circuit.js          # Circuit aggregate root
│   ├── entities/               # Domain entities
│   │   ├── Resistor.js         # Resistor entity
│   │   └── Capacitor.js        # Capacitor entity
│   ├── value-objects/          # Value objects
│   │   ├── Position.js         # Position value object
│   │   ├── Resistance.js       # Resistance value object
│   │   └── Capacitance.js      # Capacitance value object
├── application/                # Application services
│   └── CircuitAppService.js    # Circuit application service
├── infrastructure/             # Adapters and repositories
│   ├── adapters/               # Adapters for external systems
│   │   ├── CanvasAdapter.js    # Adapter for canvas interactions
│   │   └── CircuitExporter.js  # Adapter for exporting circuits
│   ├── repositories/           # Data persistence
│       └── CircuitRepository.js# Circuit repository
├── gui/                        # Graphical user interface
│   └── index.html              # Main HTML file for the GUI

Domain Layer

  • Aggregates: Encapsulate entities and value objects, ensuring consistency within the aggregate.
    • Circuit.js
  • Entities: Represent core business objects with a distinct identity.
    • Resistor.js, Capacitor.js
  • Value Objects: Represent immutable concepts with no distinct identity.
    • Position.js, Resistance.js, Capacitance.js

Application Layer

  • Application Services: Manage use cases and orchestrate domain operations.
    • CircuitAppService.js

Infrastructure Layer

  • Adapters: Convert data between the domain and external systems.
    • CanvasAdapter.js, CircuitExporter.js
  • Repositories: Handle data persistence and retrieval.
    • CircuitRepository.js

GUI Layer

  • GUI: Interacts with the user and connects to the application layer through adapters.
    • index.html

Rationale

Hexagonal Architecture allows us to isolate the core business logic from external concerns, making the system more modular and easier to maintain. By organizing the code into distinct layers, we can ensure that changes in one part of the system do not affect other parts, promoting a clean separation of concerns and enhancing testability.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published