Applying the Simple Factory Pattern: An Example of Character Creation
The Simple Factory pattern is a creational design pattern that provides a way to encapsulate object creation logic. Instead of directly instantiating classes with the new keyword, a dedicated factory class decides which concrete implementation to return based on provided input. This promotes loose coupling and centralizes change when new produc ...
Posted on Mon, 21 Sep 2026 16:21:24 +0000 by think-digitally
Generic Servlet Dispatcher Using Reflection for Method Routing
public class GenericServletDispatcher extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
...
Posted on Wed, 16 Sep 2026 16:11:10 +0000 by northk
Bridge Design Pattern: Decoupling Abstraction from Implementation
Motivation and Purpose
Some types inherently possess multiple dimensions of variation—sometimes two, sometimes more. Traditional inheritance hierarchies struggle to accommodate this complexity without creating an unwieldy class structure. The Bridge pattern exists precisely to address this challenge by separating concerns along different axes o ...
Posted on Mon, 22 Jun 2026 18:39:39 +0000 by waynerooney