0

I couldn't find any definition of the Service Object design pattern.

The Transaction Script design pattern

Organizes business logic by procedures where each procedure handles a single request from the presentation.

The Strategy design pattern

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

Are they similar/equal?

Adriano Di Giovanni
  • 1,445
  • 1
  • 16
  • 34
  • 2
    No, they're not. Why do you think they are? Do you feel the two sentences mean the same thing? Have you read more about these two patterns to understand them? What exactly do you expect from this question, other than "no"? – JB Nizet Nov 27 '16 at 16:10

1 Answers1

3

This is the definition of the Service layer pattern: http://martinfowler.com/eaaCatalog/serviceLayer.html

The service layer describes the system's use cases. These use cases are implemented in a Transaction Script manner. However, the Transaction Script pattern is a different beast - it is a way of organizing the system's business logic. So although they are similar, the intentions are different. You can implement the business logic as Active Record or Domain Model, but the Service Layer, will still resemble a transaction script.

The strategy pattern is intended to encapsulate interchangeable algorithms, that are used inside of the system's use cases.

I highly recommend reading the classic "Patterns of Enterprise Application Architecture" book to get a good grasp of these patterns.

Vladik
  • 176
  • 1
  • 7