Jump to content

OOP, DDD, AOP and EDP: Difference between revisions

From Knowledge Base
No edit summary
m Chr1ss moved page Paradigms to OOP, DDD, AOP and EDP without leaving a redirect
 
(5 intermediate revisions by the same user not shown)
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 22: Line 8:


==== Object-Oriented Programming (OOP) ====
==== 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.
[https://en.wikipedia.org/wiki/Object-oriented_programming OOP]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 [https://en.wikipedia.org/wiki/Encapsulation_(computer_programming) encapsulation], [https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance] and [https://en.wikipedia.org/wiki/Polymorphism_(computer_science) polymorphism] 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: any
     behavior
     +behavior(): void
   }
   }
   Object --|> Class
  class Class {
  Class --|> Object
    +attributes: any[]
</mermaid>
    +methods(): void
  }
   Object --|> Class: "inherits from"
 
}}


==== Domain-Driven Design (DDD) ====
==== 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.
[https://en.wikipedia.org/wiki/Domain-driven_design DDD] is a design methodology and set of principles that guide the design of complex systems, particularly those with rich domain models. DDD emphasizes understanding the problem domain, modeling it with domain objects and using [https://en.wikipedia.org/wiki/Object-oriented_programming object-oriented techniques] to represent domain concepts. It promotes the use of [https://martinfowler.com/bliki/DDD_Aggregate.html aggregates], [https://blog.jannikwempe.com/domain-driven-design-entities-value-objects entities] and [https://martinfowler.com/bliki/ValueObject.html value objects] 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: any
     behavior
     +behavior(): void
   }
   }
   DomainObject --|> Aggregate
   class Aggregate {
   Aggregate --|> DomainObject
    +elements: DomainObject[]
</mermaid>
    +process(): void
  }
   Aggregate o-- DomainObject : "aggregates"
}}


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 52: Line 43:
==== Aspect-Oriented Design (AOP) ====
==== 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.
[https://en.wikipedia.org/wiki/Aspect-oriented_programming AOP] is a design paradigm that complements [https://en.wikipedia.org/wiki/Object-oriented_programming OOP]. It focuses on modularizing cross-cutting concerns or aspects in software, such as logging, security and transaction management. AOP 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) ====


[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.
[https://en.wikipedia.org/wiki/Event-driven_architecture EDA] 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.




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


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

Latest revision as of 06:40, 17 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)

OOPis 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, inheritance and polymorphism 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 is a design methodology and set of principles that guide the design of complex systems, particularly those with rich domain models. DDD emphasizes understanding the problem domain, modeling it with domain objects and using object-oriented techniques to represent domain concepts. It promotes the use of aggregates, entities and value objects 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 is a design paradigm that complements OOP. It focuses on modularizing cross-cutting concerns or aspects in software, such as logging, security and transaction management. AOP 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 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.