Jump to content

OOP, DDD, AOP and EDP: Difference between revisions

From Knowledge Base
No edit summary
No edit summary
Line 2: Line 2:
== Paradigms ==
== Paradigms ==
Paradigms are high-level guidelines and the most abstract, followed by principles, patterns, idioms and code smells. There are also mixins, which always apply to one certain programming language.
Paradigms are high-level guidelines and the most abstract, followed by principles, patterns, idioms and code smells. There are also mixins, which always apply to one certain programming language.
{{#mermaid: graph TD
  subgraph Abstraction Level
    Paradigms[Paradigms]
    Principles[Principles]
    Patterns[Patterns]
    CodeSmells[Code Smells]
    Mixins[Mixins]
  end 
  Paradigms --> Principles
  Principles --> Patterns
  Patterns --> CodeSmells
  CodeSmells --> Mixins
}}


=== OOP, DDD, AOP, EDP ===
=== OOP, DDD, AOP, EDP ===
Line 24: Line 10:
[OOP](https://en.wikipedia.org/wiki/Object-oriented_programming) is a programming '''paradigm''' that focuses on modeling software using objects, which are instances of classes. Objects encapsulate data and behavior together. It emphasizes '''principles''' like [encapsulation](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)), [inheritance](https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)) and [polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science)) to organize code and improve maintainability. OOP is a foundational concept in software development and can be applied in various domains.
[OOP](https://en.wikipedia.org/wiki/Object-oriented_programming) is a programming '''paradigm''' that focuses on modeling software using objects, which are instances of classes. Objects encapsulate data and behavior together. It emphasizes '''principles''' like [encapsulation](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)), [inheritance](https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)) and [polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science)) to organize code and improve maintainability. OOP is a foundational concept in software development and can be applied in various domains.


<mermaid>
{{#mermaid: classDiagram
classDiagram
   class Object {
   class Object {
     data
     data
Line 32: Line 17:
   Object --|> Class
   Object --|> Class
   Class --|> Object
   Class --|> Object
</mermaid>
}}


==== Domain-Driven Design (DDD) ====
==== Domain-Driven Design (DDD) ====
Line 38: Line 23:
[DDD](https://en.wikipedia.org/wiki/Domain-driven_design) is a design methodology and set of principles that guide the design of complex systems, particularly those with rich domain models. [DDD](https://en.wikipedia.org/wiki/Domain-driven_design) emphasizes understanding the problem domain, modeling it with domain objects and using [object-oriented techniques](https://en.wikipedia.org/wiki/Object-oriented_programming) to represent domain concepts. It promotes the use of [aggregates](https://martinfowler.com/bliki/DDD_Aggregate.html), [entities](https://blog.jannikwempe.com/domain-driven-design-entities-value-objects) and [value objects](https://martinfowler.com/bliki/ValueObject.html) to capture the domain's intricacies and relationships. While OOP provides the technical foundation, DDD provides a strategic approach to using OOP effectively in the context of a specific domain.
[DDD](https://en.wikipedia.org/wiki/Domain-driven_design) is a design methodology and set of principles that guide the design of complex systems, particularly those with rich domain models. [DDD](https://en.wikipedia.org/wiki/Domain-driven_design) emphasizes understanding the problem domain, modeling it with domain objects and using [object-oriented techniques](https://en.wikipedia.org/wiki/Object-oriented_programming) to represent domain concepts. It promotes the use of [aggregates](https://martinfowler.com/bliki/DDD_Aggregate.html), [entities](https://blog.jannikwempe.com/domain-driven-design-entities-value-objects) and [value objects](https://martinfowler.com/bliki/ValueObject.html) to capture the domain's intricacies and relationships. While OOP provides the technical foundation, DDD provides a strategic approach to using OOP effectively in the context of a specific domain.


<mermaid>
{{#mermaid: classDiagram
classDiagram
   class DomainObject {
   class DomainObject {
     data
     data
Line 46: Line 30:
   DomainObject --|> Aggregate
   DomainObject --|> Aggregate
   Aggregate --|> DomainObject
   Aggregate --|> DomainObject
</mermaid>
}}


DDD is not precisely a paradigm, principle, or pattern in the traditional sense. Instead, DDD is an approach or methodology for designing and developing complex software systems.
DDD is not precisely a paradigm, principle, or pattern in the traditional sense. Instead, DDD is an approach or methodology for designing and developing complex software systems.
Line 54: Line 38:
[AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) is a design paradigm that complements [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming). It focuses on modularizing cross-cutting concerns or aspects in software, such as logging, security and transaction management. [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) separates these concerns from the core business logic and allows them to be applied consistently across the application. It does this by introducing constructs like aspects, pointcuts and advice to address concerns that often "cut across" the main code structure. AOP can be used alongside OOP to improve the maintainability and comprehensibility of complex software systems.
[AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) is a design paradigm that complements [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming). It focuses on modularizing cross-cutting concerns or aspects in software, such as logging, security and transaction management. [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) separates these concerns from the core business logic and allows them to be applied consistently across the application. It does this by introducing constructs like aspects, pointcuts and advice to address concerns that often "cut across" the main code structure. AOP can be used alongside OOP to improve the maintainability and comprehensibility of complex software systems.


<mermaid>
{{#mermaid: sequenceDiagram
sequenceDiagram
   participant Application
   participant Application
   participant Aspect
   participant Aspect
   Application ->> Aspect: Call Business Logic
   Application ->> Aspect: Call Business Logic
   Aspect ->> Application: Apply Concerns
   Aspect ->> Application: Apply Concerns
</mermaid>
}}


==== Event-Driven Architecture (EDA) ====
==== Event-Driven Architecture (EDA) ====
Line 67: Line 50:




<mermaid>
{{#mermaid: stateDiagram-v2
stateDiagram-v2
     [*] --> Active: System Startup
     [*] --> Active: System Startup
     state Active {
     state Active {
Line 75: Line 57:
         ProcessEvent --> [*]: Event Handling Complete
         ProcessEvent --> [*]: Event Handling Complete
     }
     }
</mermaid>
}}


[[File:CompanyApp.png|frameless|center]]
[[File:CompanyApp.png|frameless|center]]

Revision as of 21:48, 16 January 2025

Paradigms

Paradigms are high-level guidelines and the most abstract, followed by principles, patterns, idioms and code smells. There are also mixins, which always apply to one certain programming language.

OOP, DDD, AOP, EDP

These paradigms collectively shape modern design and implementation, each with its own unique role to play.


Object-Oriented Programming (OOP)

[OOP](https://en.wikipedia.org/wiki/Object-oriented_programming) is a programming paradigm that focuses on modeling software using objects, which are instances of classes. Objects encapsulate data and behavior together. It emphasizes principles like [encapsulation](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)), [inheritance](https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)) and [polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science)) to organize code and improve maintainability. OOP is a foundational concept in software development and can be applied in various domains.

Domain-Driven Design (DDD)

[DDD](https://en.wikipedia.org/wiki/Domain-driven_design) is a design methodology and set of principles that guide the design of complex systems, particularly those with rich domain models. [DDD](https://en.wikipedia.org/wiki/Domain-driven_design) emphasizes understanding the problem domain, modeling it with domain objects and using [object-oriented techniques](https://en.wikipedia.org/wiki/Object-oriented_programming) to represent domain concepts. It promotes the use of [aggregates](https://martinfowler.com/bliki/DDD_Aggregate.html), [entities](https://blog.jannikwempe.com/domain-driven-design-entities-value-objects) and [value objects](https://martinfowler.com/bliki/ValueObject.html) to capture the domain's intricacies and relationships. While OOP provides the technical foundation, DDD provides a strategic approach to using OOP effectively in the context of a specific domain.

DDD is not precisely a paradigm, principle, or pattern in the traditional sense. Instead, DDD is an approach or methodology for designing and developing complex software systems.

Aspect-Oriented Design (AOP)

[AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) is a design paradigm that complements [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming). It focuses on modularizing cross-cutting concerns or aspects in software, such as logging, security and transaction management. [AOP](https://en.wikipedia.org/wiki/Aspect-oriented_programming) separates these concerns from the core business logic and allows them to be applied consistently across the application. It does this by introducing constructs like aspects, pointcuts and advice to address concerns that often "cut across" the main code structure. AOP can be used alongside OOP to improve the maintainability and comprehensibility of complex software systems.

Event-Driven Architecture (EDA)

[EDA](https://en.wikipedia.org/wiki/Event-driven_architecture) is an architectural and design approach where software components communicate by producing and reacting to events. In an event-driven system, components (often objects) are designed to respond to events asynchronously, making systems more scalable, decoupled and responsive. Event-Driven Architecture can be employed within OOP and DDD to model interactions between components, such as aggregates responding to domain events. It is especially relevant in systems where real-time or asynchronous communication is critical, like in distributed systems, microservices and user interfaces.