Your SlideShare is downloading. ×
0
eSobi WebsiteeSobi Website
Multilayered
ArchitectureArchitecture
Allan Huang @ esobi Inc.Allan Huang @ esobi Inc.
Agenda
 Java EE Web Technique
 Multilayered Architecture
 Presentation / Web Service Layer
 Aspect Oriented Programmin...
Java EE Web Technique
 A tailored lightweight and multifunctional web platform
for business operations of eSobi.
 Refer ...
Presentation / Web Service
Layer
 Web Context Listener initializes/destroys needed
resources firstly/lastly while web con...
Presentation / Web Service
Layer
 HTTP Request, HTTP Response and Servlet Context
are wrapped in a Request Context is con...
Aspect Oriented Programming
 AOP (Aspect Oriented Programming) that aims to
increase Modularity by allowing the separatio...
AOP Terminology
 Join point
 A point during the execution of a program, such as the execution
of a method or the handlin...
Proxy Pattern
 A surrogate or placeholder for another object to control
access to it.
 Deferred Initialization
 Acts as...
Dynamic Proxy
 Using standard Java SE Dynamic Proxies (since JDK1.3)
for AOP proxies. This enables any interface (or set ...
Inversion of Control
 The main goal of IOC (Inversion of Control) is to remove
dependencies of an application.
 DI (Depe...
Service Locator Layer
 Singleton Service Bean Factory create all Service Bean
instances at initiate time of web context a...
Business Logic Layer
 Service Bean must implement specific service interface
that implements IGeneric Service Interface, ...
Data Access Layer
 DAO Bean must implement specific DAO interface that
implements IGeneric DAO Interface, and extends
Abs...
Domain Object Layer
 Domain Object classes must extend Abstract Entity
interface.
 Each domain class has an unique ID at...
Utility Layer
 Introduce well-known Apache Commons libraries that
contain BeanUtils, Codec, Collections, Compress,
DBCP, ...
Reference
 Spring Gossip: AOP 觀念與術語
 Aspect Oriented Programming with Spring
 Java Reflection - Dynamic Proxies
 Apach...
Q&A
eSobi Website Multilayered Architecture
eSobi Website Multilayered Architecture
Upcoming SlideShare
Loading in...5
×

eSobi Website Multilayered Architecture

255

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
255
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "eSobi Website Multilayered Architecture"

  1. 1. eSobi WebsiteeSobi Website Multilayered ArchitectureArchitecture Allan Huang @ esobi Inc.Allan Huang @ esobi Inc.
  2. 2. Agenda  Java EE Web Technique  Multilayered Architecture  Presentation / Web Service Layer  Aspect Oriented Programming  AOP Terminology  Proxy Pattern  Dynamic Proxy  Inversion Of Control  Service Locator Layer  Business Logic Layer  Data Access Layer  Domain Object Layer  Utility Layer
  3. 3. Java EE Web Technique  A tailored lightweight and multifunctional web platform for business operations of eSobi.  Refer some of 14 rules on the book High Performance Web Sites.  Design Presentation and Web Service Layer by referring MVC concept and structure of Struts 2  Design Business Logic Layer and Data Access Layer by referring AOP and IoC concept of Spring 2  Auto-setup all bean instances by using the extends and implements declarations to reduce the amount of configuration files.
  4. 4. Presentation / Web Service Layer  Web Context Listener initializes/destroys needed resources firstly/lastly while web context is loaded/unloaded.  Resource Access Filter intercepts any HTTP requests, and handles/passes/rejects them, further forward them to the next handler/servlet.  The main goal of HTTP ETag Response Stream, HTTP Cache-Control Header and Compressed Response Stream reduce the amount or frequency of HTTP response transmission.
  5. 5. Presentation / Web Service Layer  HTTP Request, HTTP Response and Servlet Context are wrapped in a Request Context is convenience to be passed to Controllers.  Page Action and it’s Controller handle HTTP requests and return an HTML page via Page Forward or Page Redirect.  AJAX Call and it’s Controller handle HTTP requests and return an JSON string that wrapped in AJAX Call Return and JSON Message.  Remote Command and It’s Controller handle HTTP requests and return an XML string in Remote Command Return and XML Message.
  6. 6. Aspect Oriented Programming  AOP (Aspect Oriented Programming) that aims to increase Modularity by allowing the separation of Cross- Cutting Concerns.
  7. 7. AOP Terminology  Join point  A point during the execution of a program, such as the execution of a method or the handling of an exception.  Advice  Action taken by an aspect at a particular join point. Different types of advice include "around," "before" and "after" advice.  Pointcut  A predicate that matches join points.  Weaving  linking aspects with other application types or objects to create an advised object. This can be done at compile time, load time, or at runtime.
  8. 8. Proxy Pattern  A surrogate or placeholder for another object to control access to it.  Deferred Initialization  Acts as a "stand-in" for the actual implementation allowing it to be instantiated only when absolutely necessary.  Security  Verify that the user actually has the permission to execute the method.  Logging  Log every method invocation, providing valuable debugging information.  Performance Monitoring  Log each method invocation to a performance monitor allowing system administrators to see what parts of the system are potentially bogged down.
  9. 9. Dynamic Proxy  Using standard Java SE Dynamic Proxies (since JDK1.3) for AOP proxies. This enables any interface (or set of interfaces) to be proxied.
  10. 10. Inversion of Control  The main goal of IOC (Inversion of Control) is to remove dependencies of an application.  DI (Dependency Injection) is a subtype of IoC and is implemented by constructor injection, setter injection or method injection.
  11. 11. Service Locator Layer  Singleton Service Bean Factory create all Service Bean instances at initiate time of web context and put them into it’s own pool. DAO Bean Factory is the same as above circumstances.  According to AOP, all bean instances are constructed by Java SE Reflection API and create dynamic implementations of interfaces at runtime by Java SE Dynamic Proxy API.
  12. 12. Business Logic Layer  Service Bean must implement specific service interface that implements IGeneric Service Interface, and extends Abstract Generic Service.  Transaction Adviser is responsible for opening SQL connection, executing target method, committing result, and finally close SQL connection by Java SE Dynamic Proxy API.  Thread Local<Stack> of Transaction Adviser keeps track of each target method recursively via push and pop action per thread lifecycle.
  13. 13. Data Access Layer  DAO Bean must implement specific DAO interface that implements IGeneric DAO Interface, and extends Abstract Generic DAO.  JDBC Utility is responsible for setting SQL Data Source at initiate time of web context and closing Data Source at destroy time of web context.  Thread Local<Connection> of JDBC Utility keeps track of concurrent connection per thread lifecycle.
  14. 14. Domain Object Layer  Domain Object classes must extend Abstract Entity interface.  Each domain class has an unique ID attribute as primary key and its default equals and hashCode methods are overridden.  Relationships be expressed as Java List or Set structure among domain classes are constructed by according to E-R model.
  15. 15. Utility Layer  Introduce well-known Apache Commons libraries that contain BeanUtils, Codec, Collections, Compress, DBCP, DbUtils, Email, FileUpload, IO, Lang, Logging, Net, Primitives, Proxy, and Log4J, Xerces, etc.  Develop Utility classes (framework) that are independence on Java EE web container based on above libraries.
  16. 16. Reference  Spring Gossip: AOP 觀念與術語  Aspect Oriented Programming with Spring  Java Reflection - Dynamic Proxies  Apache Commons Proxy
  17. 17. Q&A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×