Skip to main content
edited tags
Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623
Tweeted twitter.com/StackProgrammer/status/768542981896957952
added 180 characters in body
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157

I mI'm studying the SOLID paradigmprinciples and I'm having some troubles dealing with the specification patternSpecification Pattern and the open closed/closed principle.

The fact is that the Specification pattern introduced by Eric Evans and Martin Fowlers creates some abstraction and a really open way to manage business rules.

enter image description here

But I was wondering if it was really based on Open/closed principle.

The fact is that, when we need a new rule, we can extend it from our parent specification class. So, it's open in extension, that is a good point from a SOLID point of view.

On the other hand, specification pattern is based on rules combination, so we have to modify the rules code, or at least, the parent rule code. This way, we're open in modification in a class that, in my mind, should not be modified.

I mI'm probably misunderstandingmissunderstanding something in this process.

Can anybody explain me why (if it's the case) specification pattern respects the OC principle ? Does it exist an alternative to this pattern ?:

  • How does (if it's the case) the specification pattern respect the OC principle ?
  • Does it exist an alternative to this pattern ?

I m studying SOLID paradigm and I'm having some troubles dealing with the specification pattern and the open closed principle.

The fact is that the Specification pattern introduced by Eric Evans and Martin Fowlers creates some abstraction and a really open way to manage business rules.

But I was wondering if it was really based on Open/closed principle.

The fact is that, when we need a new rule, we can extend it from our parent specification class. So, it's open in extension, that is a good point from a SOLID point of view.

On the other hand, specification pattern is based on rules combination, so we have to modify the rules code, or at least, the parent rule code. This way, we're open in modification in a class that, in my mind, should not be modified.

I m probably misunderstanding something in this process.

Can anybody explain me why (if it's the case) specification pattern respects the OC principle ? Does it exist an alternative to this pattern ?

I'm studying the SOLID principles and I'm having some troubles dealing with the Specification Pattern and the open/closed principle.

The fact is that the Specification pattern introduced by Eric Evans and Martin Fowlers creates some abstraction and a really open way to manage business rules.

enter image description here

But I was wondering if it was really based on Open/closed principle.

The fact is that, when we need a new rule, we can extend it from our parent specification class. So, it's open in extension, that is a good point from a SOLID point of view.

On the other hand, specification pattern is based on rules combination, so we have to modify the rules code, or at least, the parent rule code. This way, we're open in modification in a class that, in my mind, should not be modified.

I'm probably missunderstanding something in this process.

Can anybody explain me:

  • How does (if it's the case) the specification pattern respect the OC principle ?
  • Does it exist an alternative to this pattern ?
edited body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

I m studying SOLID paradigm and I mI'm having some troubles dealing with the specification pattern and the open closed principle.

The fact is that the Specification pattern introduced by Eric Evans and Martin Fowlers creates some abstraction and a really open way to manage business rules.

But I was wondering if it was really based on Open/closed principle.

The fact is that, when we need a new rule, we can extend it from our parent specification class. So, it's open in extension, that is a good point from a SOLID point of view.

On the other hand, specification pattern is based on rules combination, so we have to modify the rules code, or at least, the parent rule code. This way, we're open in modification in a class that, in my mind, should not be modified.

I m probably misunderstanding something in this process.

Can anybody explain me why (if it's the case) specification pattern respects the OC principle ? Does it exist an alternative to this pattern ?

I m studying SOLID paradigm and I m having some troubles dealing with the specification pattern and the open closed principle.

The fact is that the Specification pattern introduced by Eric Evans and Martin Fowlers creates some abstraction and a really open way to manage business rules.

But I was wondering if it was really based on Open/closed principle.

The fact is that, when we need a new rule, we can extend it from our parent specification class. So, it's open in extension, that is a good point from a SOLID point of view.

On the other hand, specification pattern is based on rules combination, so we have to modify the rules code, or at least, the parent rule code. This way, we're open in modification in a class that, in my mind, should not be modified.

I m probably misunderstanding something in this process.

Can anybody explain me why (if it's the case) specification pattern respects the OC principle ? Does it exist an alternative to this pattern ?

I m studying SOLID paradigm and I'm having some troubles dealing with the specification pattern and the open closed principle.

The fact is that the Specification pattern introduced by Eric Evans and Martin Fowlers creates some abstraction and a really open way to manage business rules.

But I was wondering if it was really based on Open/closed principle.

The fact is that, when we need a new rule, we can extend it from our parent specification class. So, it's open in extension, that is a good point from a SOLID point of view.

On the other hand, specification pattern is based on rules combination, so we have to modify the rules code, or at least, the parent rule code. This way, we're open in modification in a class that, in my mind, should not be modified.

I m probably misunderstanding something in this process.

Can anybody explain me why (if it's the case) specification pattern respects the OC principle ? Does it exist an alternative to this pattern ?

Source Link
mfrachet
  • 1.6k
  • 3
  • 15
  • 23
Loading