Extrait du cours J2EE best practices using Real-life Examples
What Is Needed…
-Learning the technology is not enough
-Industry best practices
-Proven solutions
-How to avoid bad practices?
-Experience and expertise
Core J2EE ™ Patterns
– Platform Patterns for J2EE ™ architecture
– Based on our experience
– Collection of best practices for J2EE™ platform
– J2EE ™ architecture refactorings and bad practices
– Create a common vocabulary
– Proven solutions
– Reuse design
– Robust and scalable architecture
– Improve quality
– Flexibility and maintainability
Rationale for Layers
– More flexible, extensible:
– Presentation Layers
– Frequent changes, designed to be flexible
– Business Services
– Implement “use-cases”
– Public interface, resource access
– Should remain valid for changes in presentation and data store
– Data Layers
– Fewer changes, designed to optimize data access
Layered View (cont.)
-Layered View helps to:
– Clearly divide responsibilities
– Decouple business logic completely
– Provide a common “place” for preprocessing and post-processing of requests and responses (like logging translations, transformations, etc.)
– Expose a web service interface to existing business logic
Cache for Performance
– Some things can be cached and shared (singleton):
– InitialContext object
– Anything retrieved from JNDI, EJB Home interfaces
– Repeated lookups can be expensive! Use Service Locator Pattern
– Some things are cached by individual clients (session):
– Cache search results when you are only displaying a few at a time (non-transactional data)
– JDBC™ CachedRowSet
– Value List Pattern
……..
Cours J2EE Best Practices using Real-life Examples. (2305 KO) (Cours PDF)