In Java, creating a local HTTP server is very easy. You can add more context to handle more HTTP paths.
Most important Design Principles in a row Single Responsibility principle Open Closed principle Liskov Substitution principle Interface Segregation principle Dependency Inversion principle YAGNI DRY
A short explanation and usage of Annotations General rules: @ sign at the front of interface keyword Method declarations defines annotation elements Return types are: String, Enum, Class, Annotation, primitive and Arrays of these types Methods can have default falues usage : Annotation sorts: 1. Marker annotation : these type annotations have no … More Java Annotations in Short
Dynamic proxying is used widely in the frameworks, so a basic understanding of the implementation can be helpfull to use those frameworks. Of course, there can be a situation where a dynamic proxy implementation can be a good choice. Here a simple example of a dynamic proxy implementation using Java 8 If … More Java Dynamic Proxy
Interceptor example in Java EE to enable the interceptor, either add an element to beans.xml like: or add a Priority annotaion Interceptors enabled using @Priority are called before interceptors enabled using beans.xml, the lower priority values are called first.
Decorator example in Java EE to enable the decorator, either add an xml element in de beans xml or add a priority to the code Decorators enabled using @Priority are called before decorators enabled using beans.xml, the lower priority values are called first.
Event based processing can be done on the following way in Java EE 6: Servlets can be decoupled easier with the business code using the Observer pattern: