Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages