Posted In: Pattern, Spring

Use of strategy pattern in Spring – ContentNegotiationStrategy

Strategy pattern The strategy pattern defines a family of algorithms, encapsulates each algorithm, and makes the algorithms interchangeable within that family. Spring defines following strategy classes which implements ContentNegotiationStrategy FixedContentNegotiationStrategy ParameterContentNegotiationStrategy PathExtensionContentNegotiationStrategy ServletPathExtensionContentNegotiationStrategy Then uses org.springframework.web.accept.ContentNegotiationManager to apply strategy.

Read More

Tags:

by , on July 25th, 2017

Posted In: Pattern, Spring

Use of adapter pattern in Spring – CompletableToListenableFutureAdapter

Adapter pattern Adapter pattern allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code. In this example adapter takes CompletableFuture as constructor argument and returns Spring ListenableFuture.  

Read More

Tags:

by , on July 24th, 2017

  • Categories