Sunday, August 29, 2010

Famous J2EE (Java EE) Design Patterns

As most of my friends and juniors occasionally ask about frequently and popular J2EE patterns. So I thought of listing down patterns which every Java developer or designer should know. I'm dividing patterns into presentation, business and integration tier.

List of popular patterns & its usage which comes under Presentation Tier:
1. Intercepting Filter:
  • It can be used when there is a requirement of centralized and common processing across requests
  • When pre and post processing is required across or selected requests
2. Front Controller (& Application Controller):
  • When there is a requirement of common logic to multiple requests
  • When there is a requirement of separate processing logic from the presentation view
  • When there is a requirement of centralized controlled access points
3. View Helper:
  • When template based views is required like JSP, Apache Velocity etc
  • When separate programming logic from view
4. Service To Worker:
  • Service To Worker = Front Controller + Application Controller + View Helper
  • Any presentation framework like Apache Struts

List of popular patterns & its usage which comes under Business Tier:
1. Business Delegate:
  • When business-tier access from presentation-tier
  • Hides service creation, invocation
2. Service Locator:
  • Patterns can be used when lookup to any enterprise resource like JNDI lookup, JMS, web services etc
  • When requirement of centralized and reuse (cache or reestablish connection) lookup
3. Session Facade:
  • When requirement is to avoid direct client access to application's business-tier
  • When requirement is to hide complex integration of business components
4. Transfer Object:
  • When requirement is to access component of different tier to retrieve and update data
  • When requirement is to reduce remote requests across the tier and network (enhance network performance)
5. Value List Handler:
  • When requirement is to avoid the overhead of using EJB "finder" methods
  • Requirement of an efficient search and iterate searched data
  • Cache search result on the server side

List of popular patterns & its usage which comes under Integration Tier:
1. Data Access Object:
  • Requirement of uniform data access APIs
  • Requirement of decouple persistent storage from other tier
2. Service Activator:
  • Requirement is to call business service, EJBs in an asynchronous manner
  • Requirement is to plug topic and point-to-point messaging to enable async process
3. Web Service Broker:
  • It is like exposing services to client i.e. web service
Above are main patterns which generally been used in J2EE based application. Some patterns which internally been used by frameworks like Apache Struts and Java EE components like JPA.

Friday, August 27, 2010

SaaS & Clould Computing - Design Consideration

Design a SaaS application is a big challenge. There are lots of dimension which we need to look upon while designing the application like maturity level, business goals, business & architecture principles, operational model etc.

According of Microsoft, SaaS application has a four maturity levels:
1. Ad Hoc/Custom: Each client or tenant has its own server instance and application code as modified to meet their requirements.

2. Configurable: In this level, each tenant or client hosts a separate instance of the application for each customer but the code-base remain same for each client i.e. application it quite configurable to support each customer.

3. Configurable, Multi-Tenant-Efficient: Each client or tenant runs on a single instance that serves every customer, with configurable metadata providing a unique user experience and feature set for each one. Only restriction of this level is that it can not be scalable across servers so performance and availability will be issue of this level.

4. Scalable, Configurable, Multi-Tenant-Efficient: This level multiple client or tenant are supported by the load-balanced farm of identical instances, with each tenant data/information kept separate, and with configurable metadata providing a unique user experience and feature set for each tenant/client.

As far as design and flexibility is concern, SaaS application should design for level 4.

Following are the design consideration of SaaS application:
1. Multi-Tenancy: Application should be design to handle multi-tenancy like data, UI, business rules etc should be separated per customer.

2. Security: Application design should ensure security of customer data is secure and there should be complete separation of data between customer/tenant. Also authentication should be "pluggable" to customer's enterprise identity management.

3. Availability: Application should be easily scalable and clusterable so that it is available anytime.

4. Scalable: Application design should be highly scalable and it should easily cope large organization and user base.

5. Data Model Extensibility: Database should be easily be tailor to the fulfill the need of each vendor without affecting the others.

6. Flexible Presentation: UI should be highly configurable and flexible so that it able be easily be customizable for each vendor without affecting the others.

7. Performance: Application should have less response time (for complex page also) and transactional processing time.

8. Configurable Business Rule/Process: Application should be design to support addition/customization of individual tenant/companies business rules/processes. Also application should seamlessly integrate with tenant's enterprise business processes.

9. Multi-language Support: Application should internationalization so that different tenant uses across the Internet and around the world.

10. Separation of Concern: Application should be design on concept of SOA and Separation of Concerns so that it can easily be deployed in cloud and cloud-bus can be plugged to communicate with different cloud and on-premises. Also business agility or time-to-market will be other advantage of this design pattern.


So, any application follow above design consideration then it can easily get the advantage of maturity "Level 4" and ported in cloud environment.

Friday, August 13, 2010

SaaS and Cloud Computing - An Overview

To understand SaaS in a simple way just think of email offering from Google (as gmail) where multiple clients i.e. email id owner can send / receive mails and can use other features provided by the Google.

Google's mail servers are in Cloud, which can be easily scalable. So this is a perfect example of SaaS and Cloud Computing.

Below figure help you in visualizing SaaS and Cloud Space:So SaaS can be offered as paid service like subscription service. These services can be form of domain specific application such as CRM, and SCM etc. For more detail, visit www.salesforce.com. salesforce application has a complete CRM solution deployed in his cloud environment. Generally vendor or site user will be charged on usage basis and each SaaS provider will has metering capability.

Other kind of service like free or partial free services such as web mail services (i.e. gmail), job site, etc.

Following are the main advantages while adopting SaaS option:
1. Faster time-to-market
2. Cost effective options (in most of case)
3. Lower license cost
4. Nearly zero maintenance and software upgrade cost
5. Good option for start-up companies.
6. Pay on usage basis

Apart from some good advantages, there are some issues and limitation of SaaS application:
1. Non-Scalable design: Generally SaaS application is expected to handle large customer base and scale seamlessly in cloud but non-scalability nature of SaaS application leads deterioration in performance.
2. Hidden cost of SaaS provider
3. Data Security as multiple user/customer will use the same database
4. Availability of SaaS application

Top SaaS Providers:

There are lots of SaaS providers in all the domain areas including CRM, SCM, Health Care, Retail etc. Following are the market leader in SaaS:

1. salesforce: It provide CRM software on-demand. It has various pricing model starting with free subscription, and pay-as-you-go model. Currently they offer two SaaS services:
  • Sales Cloud: It has accounts, contacts, leads, quotes, etc.
  • Service Cloud: It has customer portal, knowledge base, and analytics, etc.

2. Google: It has range of applications as well as web-based offerings. like e-mail service, calendar, document editor, spreadsheet, and some others.

3. Zoho: It has also web-based e-mail service, document editor, presentation tool, invoicing, reporting, applicant tracking, and many more.

Next topic which I will going to cover is SaaS & Cloud Computing - Application Design Consideration.

Thursday, August 12, 2010

Crack Sun Certified Enterprise Architect (SCEA) Exam

Most of the aspiring architects frequently asked me "how to clear SCEA (OCMJEA) exam" so I thought to write some basic points and approach to crack this exam.

This certification is very easy to pass if you have the understanding of design patterns. Understanding does not means that you know the definition of patterns, but it means you did some Java EE based application designing in past and applied various patterns. This will going to help you in answering patterns related questions as well as architecture related questions.

So if you have above experience then half of your battle won. And if you haven't done then its better to hold your horse and wait for some time .... some application design & apply patterns. "Practical experience is must" .......

Other things which you need to study like application security parameters, design consideration of thick client, EJB 3.0 usage, presentation framework, and application integration techniques.

Few good study materials are:

1. The Java EE 5 Tutorial, Third Edition (http://java.sun.com/javaee/5/docs/tutorial/doc/JavaEETutorial.pdf)

2. Core J2EE Patterns: Best Practices and Design Strategies, Second Edition

3. Java Design: Objects, UML, and Process

4. Designing Enterprise Applications with the J2EE Platform

5. Enterprise Integration Patterns

6. The Java EE 5Tutorial - For Sun Java System Application Server 9.1

7. Sun Certified Enterprise Architect for J2EE Study Guide

8. Core Security Patterns: Best Practices and Strategies for J2EE, Web Services, and Identity Management



For SCEA Part 2 & 3, refer my next article.