Thursday, July 26, 2007

Internationalization of web pages

Here are few tips for support of different languages in java web project.
I'll post in detail after i finish with it.
But if you want to use javascript alerts in different languages,
don't forget to consider that IE ignores charset information in script tag when displaying Javascript alerts.
For example: if you are using UTF8 as charset for script file which contains chinese alerts as :

SCRIPT LANGUAGE="JavaScript" charset="UTF8" src="test_zh_CN.js"

IE will display blocks instead of chinese words in alert if your Operating System (Windows) language setting is not selected for Chinese.
There is no problem in Mozilla, Opera etc.
To get more information, check this link :
http://www.w3.org/International/

Wednesday, June 27, 2007

Aspect Oriented Programming (AOP)

Basic Concept:
Aspect means Feature.
Aspect Oriented Programming is related to common features of system which spans across all levels of
framework.
eg. -- Logging, Security, Transaction Management....
AOP is a tool for implementing all these crosscutting concerns.

To know what AOP is check the link :
http://www.aspectprogrammer.org/blogs/adrian/2004/05/the_ted_neward.html

I found this link very useful to get the basic idea about AOP.

Types of AOP: There are two distinct types of AOP, static and dynamic.
Static :AspectJ
dynamic: JoyAop

AOP implementation approaches :

1. Class-weaving-based : Class weaving is the process of integrating the concern implementations to form the
final system. Weaving can be performed at compile, load, and run time.
eg: AspectJ, JBpss AOP

2: Proxy based: Method invocations on an object can be intercepted to inject custom code.
AOP frameworks use JDK dynamic proxy, CGLIB proxy, or both.
eg: Spring AOP.

Note: JDk proxy can proxy interfaces while CGLIB proxy can proxy classes also


I am still very new to AOP. But the concept attracted me to know more about it.
So i'll find how much useful AOP is to implement.

Tuesday, March 27, 2007

Stored Procedure and Java Persistence Frameworks

If you are using Stored Procedure for all Database related stuff, then here are few guidelines (for using Java persistence framework for database related stuff).
Stored Procedure is good option to avoid any SQL Injection Attack.

Hibernate is the first option in my mind because of its popularity. At the same time we were going through spring framework documents, so DB connectivity using spring was another option (Using Spring's Stored Procedure class)

But after going through hibernate docs, we realised that, using Hibernate is not possible (with Stored Procedure) because
1 If we are using stored procedures for DB related stuff, hibernate support for Stored Procedure is very limited.
2. Hibernate is better when we want auto generated SQL(Hibernate generated) and where writing custom SQL is not necessary.

We also tried Spring's DB connectivity. But for that we have to create separate class to handle each stored procedure.

We came across another option ie. iBATIS Data Mapper.
(reason : performance of iBATIS is very close to normal JDBC
See link : http://www.devx.com/Java/Article/33768/1954?pf=true )

When we went through documents of iBATIS, it was very close to what we need.
ie. Stored Procedure support of iBATIS is very good as compared to other Java DB persistence frameworks like Hibernate. And one more thing, it is very easy to implement iBATIS in your application. Simplicity is the biggest advantage of the iBATIS Data Mapper over object relational mapping tools.

According to me, iBATIS is a very good option if you are using Stored Procedure and want to use any Java persistence framework.



Hibernate and iBATIS
:
iBATIS maps Java objects to the results of SQL Queries, whereas Hibernate maps Java Objects directly to database tables, ie. Object-Relational Mapping.
The benefits of Hibernate are that it automatically generates all the SQL for you and the cache invalidation can be more fine grained. iBATIS is more flexible especially if you are a strong SQL query writer. You have control over exactly how the SQL queries are written.

Wednesday, March 7, 2007

Special Day for me

Today is very special day for me.
2 Reasons:
Today is my sweet and best friend's Birthday.
Ketu... my uncle's son.... 13 yrs old.
Missing you very much my sweet heart.
and
Shiv Jayanti
SALUTE TO GREAT KING ON HIS BIRTH DATE.

Ok. Bye. Have a nice day.

Friday, March 2, 2007

Happy Holi to all

Wish You all colourful holi....
Month of festivals begins.
Lot many festivals And also..........
don't forget 11 March:---- Day on which Shambhuraje(Sambhaji Maharaj) sacrificed his life.

Bye Bye and Enjoy weekend with lot of colours.........

Thursday, February 22, 2007

is there single JSP instance in server for every JSP page?

If isThreadSafe attribute is set to false
like
<%@ page isThreadSafe="false" %>
the container may create multiple instances of the JSP servlet to handle
concurrent requests or use synchronization to control access to a single instance.
but Both approaches are likely to reduce the performance of the page
because of the overheads of instantiation and locking respectively..
so this directive should be used with caution..
means if we set isThreadSafe= false, container may create multiple instances of jsp,
but for each new instance page has been instantiated means compiled and loaded which reduces performance..

Shambhuraje(Sambhaji Maharaj)

Shambhuraje(Sambhaji Maharaj)....
Son of great Shivaji Maharaj...
My tribute to great person for his sacrifice...

Though there would be many technology posts, i prefer blog title as Shambhuraje....
Dedicated to the person who is ideal in my life....

Statue of Sambhaji Raje at Tulapur, Pune