eSobi Website Multilayered Architecture

100 %
0 %
Information about eSobi Website Multilayered Architecture

Published on March 15, 2014

Author: AllanHuang


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 Programming  AOP Terminology  Proxy Pattern  Dynamic Proxy  Inversion Of Control  Service Locator Layer  Business Logic Layer  Data Access Layer  Domain Object Layer  Utility Layer

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.

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.

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.

Aspect Oriented Programming  AOP (Aspect Oriented Programming) that aims to increase Modularity by allowing the separation of Cross- Cutting Concerns.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Reference  Spring Gossip: AOP 觀念與術語  Aspect Oriented Programming with Spring  Java Reflection - Dynamic Proxies  Apache Commons Proxy


Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

CodePlex - Layered Architecture Sample for .NET - Home

Layered Architecture Sample is designed to demonstrate how to apply various .NET Technologies such as WPF, WCF, WF, Windows Form, ASP.NET and ADO.NET EF to ...
Read more

eSobi Download |

eSobi Download auf News und RSS Reader, Podcast Multimedia, Internetsuche und Informations-Archiv. Jetzt kostenlos downloaden!
Read more

*eSobi News

... take a look at these London architecture related news. ... fast way to keep their eSobi News Reader ... from eSobi Website and will soon ...
Read more

Multilayered architecture (1) – Introduction ...

Multilayered Architecture (3) – The Application Layer ... Website. Your comment. Search for: Recent Posts. Manage the unknown; What should influence your ...
Read more

symfony2 - How To Implement Multi Layered Architecture in ...

How to implement multi Layered architecture in PHP ? ... What is difference of developing a website in MVC and 3-Tier or N-tier architecture?
Read more

Understanding Multilayered Architecture in .NET

Understanding Multilayered Architecture in .NET. ... Open your Visual Studio and add a simple website to the solution, name it Presentation Layer.
Read more

A practical introduction to layered architecture — Part ...

A practical introduction to layered architecture — Part One. April 12, 2009. When it comes to building websites or web applications, almost everyone has ...
Read more

Jacques Ferrier Architecture, Chartier Dalix and SLA ...

Jacques Ferrier Architecture, Chartier Dalix and SLA Architects Unveil Their Multi-Layered City Design for Reinventer.Paris
Read more