Skip to content

elemental-source/strategy-pattern-with-dependency-injection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Strategy (and Factory) pattern with dependency injection

Lot of options for how to implement Strategy Pattern with dependency injection using Spring.

Problem

Given an enum, we need follow a determined flux in application and to return always the same object type.

We would like of a dynamic and uncoupled solution (obviously).

The exciting part of the history is that each strategy is a Bean (the project uses Spring).

Solution

We think about use Strategy Design Pattern.

For this reason, we have built several strategies with the objective can choose dynamicly the Bean.

See the options.

Which is the best implementation? Some suggestion?

🤘

About

Strategy pattern with dependency injection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages