Archive

Archive for January, 2008

Portal Development

A Portal represents a web site that provides a single point of access to applications and information. A page can contain more than one portlets, users can enter portal with different access, personalization user can customization look & feel, features.

One can create Portals using Weblogic / Websphere etc for web portal or content management

Portlets ex: There can be a search portlet, a calendar portlet etc.

A portal can have Pages, each page has one or more of portlets  – they can communicate with each other or transfer data so one needs to understand the inter portlet communication,behaviour, user can personalize how one wants the portal to look on the whole by selecting the themes, features or functionality one can add as portlets, their location on the page etc.

The life cycle of a portal can be mainly categorized

Design  – Understand and setup ur portal development environment, configuration setup of portal.

Develop  – Portal development, Data transfer, Inter portlet communication, Integrating portlets are involved here

JSP Portlets/ HTML Portlets, Java Portlets(jsr) , Struts Portlets, JSF Portlets, Remote Portlets – one can choose what type of portlets to use suiting the navigational, functional requirements.

Stage - In a different environment than the development environment, the portals are managed and deployed, tested out well before moving to production

Production  – Portal is live in production to end users.

Performance Optimization Java J2EE Aplications

January 30, 2008 1 comment

One can optimize the performance of Java J2EE Application by considering some of the design level, system level, application level changes.

- Design level factors by following effective design patterns for a problem

- Application level considering by looking into app server tuning, coding details etc.

 -identify the potential issues like memory leakage, security issues, transactional issues, extendability, maintainability issues

Search Engine optimization

Search engine optimization is possible through html coding tools, page rank, toolbar page rank

Also by xml sitemaps, meta tags

One can optimize a web site based on page elements, LSI (latentsemantic analysis), it is used in web analytics, to track the traffic patterns, identifying target keywords etc …

Business Delegate – Design Pattern

January 30, 2008 1 comment

Data flows between the tiers in the multi-tiered, when the presentation components are interacting with business services, their implementation details are exposed. The domain object is converted into business object.

In distributed applications, lookup for remote business component when applications use business component directly, application code must change to reflect changes in business component APIs.

An Intermediate class is introduced called business delegate, which decouples business components from the code that uses them.

- Decouple application tier from business tier

 The Business Delegate pattern manages the complexity of distributed component lookup and may adapt the business component interface to a simpler interface for use by views.

 business_delegate.jpg

Business Delegate interacts with business tier api service for domain object.

 multi-tier-architecture.jpg

Normalization

First Normal form : Attribute should be atomic. One should be able to identify the functional dependency(identify a non key attribute which is depends on key attribute) at this point

Second Normal Form : Non-Key attribute should be fully functionally dependent on key Attribute. Eliminate any partial dependency(Identify an attribute which is partially depends on key attribute) at this point.

Third normal Form : There is no transitivity dependency between attribute. So one can identify and delete transitive dependency.

Forth Normal Form : Any attribute(simple or composite) is an attribute on which some other attribute is fully functionally dependent.

Hibernate

Hibernate – It is written in java, an open source project, provides ORM (Object Relational Mapping) solution, technology for persisting data in any kind of application. Powerful object-oriented persistence, hibernate query language, the object oriented concept is similar to java for association, inheritance, polymorphism, composition and collection. It has automatic primary key generation, perists the java objects into database table format using the metadata that defines the object & database mapping.  ORM tools address the CRUD operations on the objects of persistent classes. Web applications due to database traffic will have performance issues. Caching is the best technique to solve the heavy traffic performance problem.

One can achieve lazy loading in hibernate – loads parent objects first and later the child objects, an ORM technique.

Advantages:

- High performance

- Object Relational Mapping ORM solution is better

- Object-Oriented Query language

- One can avoid rewriting queries

- Easy Maintenance and ease to developer to concentrate on business logic rather than maintenance functionality.

Disadvantages:

- Lacks performance related to connection management and transactonal management

Hibernate xml mapping document defines the properties, mapping details

Hibernate XML Mapping Document Example:

Hibernate XML Mapping Document Example

Hibernate Architecture:

The below diagram shows Hibernate using the database and configuration data to provide persistence services /objects to the application.

Hibernate Architecture

There are couple of hibernate plugins (open source available) for Eclipse, Visual Studio etc. 

Spring

Spring – It is a light-weight framework that supports IOC, adopts extensively for building java or j2ee applications for enterprise applications. It integrates well with most of the prevailing popular technologies like hibernate, struts, jms, mq series in the presentation, middle tier, persistence apis. It does not provide tight coupling between the Business objects, it is fast to do Unit Testing so that Test Driven Development(TDD) .

Spring modules are in SPRING_HOME\dist\modules

Spring webMVC (spring- webmvc.jar)
Spring AOP (spring aop.jar)
Spring Beans (spring-beans.jar)
Spring Core (spring-core.jar)
Spring Dao (spring-dao.jar)
Spring Hibernate (spring-hibernate3.jar)
Spring Ibatis (spring-ibatis.jar)
Spring Jca (spring-jca.jar)
Spring Jdbc (spring-jdbc.jar)
Spring Jdo (spring-jdo.jar)
Spring Jms (spring-jms.jar)
Spring Jms (spring-jpa.jar)
Spring Jmx (spring-jmx.jar)
Spring Portlet (spring-portlet.jar)
Spring Remoting (spring-remoting.jar)
Spring Struts (spring-struts.jar)
Spring Support (spring-support.jar)
Spring Toplink (spring-toplink.jar)
Spring Web (spring-web.jar)
Spring Aspects (spring-aspects.jar)

AJAX Performance Design issues

Asynchronous Javascript + XML = AJAX – It is Client Server Technology, The web page is refreshed without reloading the entire page, it is the user interface with javascript. One needs expertise in html, css, javascript, DOM, asynchronous data exchange. The client in this case needs to connect to web server to facilitate the communication and data transfer.

Ajax limitations

*It is a bit slow

*End user experience is effected by the round trip behavior  as it is slower 

*if  not designed well it will affect the performance.

ajax widgets to your site using ajax tags which supports multiple browsers, rich library of ajax components, they are lot of free community edition – ajax widgets , navigational widgets, form, data widgets available on net.

Search Engine optimization

Search engine optimization is possible through html coding tools, page rank, toolbar page rank

Also by xml sitemaps, meta tags

One can optimize a web site based on page elements, LSI (latentsemantic analysis), it is used in web analytics, to track the traffic patterns, identifying target keywords etc …

Multi threading – performance

Multi threading – synchronization, sharing of resources multi threads access, multiple threads running in a system. One of the thread can modify shared variable while another thread is in the process of updating same shared variable. inheriting from Thread class, runnable interface. Handle multiple clients at the same time. The methods that are used for inter thread communication are wait(), notify() and notifyall(). When a thread terminates its processing, it enters the dead state. A lock can be acquired on a class.
The OS (operating systems) systems task scheduled allocates execution time to multiple tasks.

Synchronized can be defined at Method level or for a block as the statements within {}

Performance concerns of I/O- Threads block on i/o – it enters the waiting state, meanwhile the other threads may execute while the i/o Operation is performed. Changing the multi-threading level improves performances and reliability.

Follow

Get every new post delivered to your Inbox.