Javy Writes Here

January 4, 2008

Design Patterns used in JDK

Examples of the common design pattern strategies used in some of the core classes in Java SDK.

  • Creational Patterns
    • Singleton : java.lang.Runtime
  • Structural Patterns
    • Facade : JDBC framework
    • Flyweight : java.lang.String uses ‘pool of constants’.
    • Proxy : RMI Framework

November 26, 2007

Log4J : Why use isDebugEnabled() in your code

Filed under: Technology — javywrites @ 7:34 am
Tags: ,

When using log4j or apache logging, use

if (log.isDebugEnabled()) log.debug("My debug message " + makeOnlineMessagePart());

instead of

log.debug("My debug message " + makeOnlineMessagePart());

The rationale is that the first case doesn’t compose the whole message if the debug is not enabled. The second one does create a possibly expensive message for no purpose even if log4j configuration or underling logging subsystem disables debugging.Source:http://www.javalobby.org/java/forums/t18758.html

November 22, 2007

Reincarnation of Java objects : Serialization and Externalization

– In case of Serialization, the reconstruction ( de-serialization ) occurs using the bits from the stream used to reconstruct.
- In case of Externalization, the reconstruction happens in this order: the public no-arg constructor is called; then readExternal(..) is invoked.

However in case of serialization, when unpacking the object tree, if one of the superclass does not implement Serializable, then the constructor is invoked from that superclass and upwards.

November 8, 2007

Java Security Technologies

Filed under: Interview Tips — javywrites @ 1:12 pm
Tags:

For a professional with atleast 3 years experience in areas of Java & Network Security, the following areas is a must to brush up, for an interview

  • JAAS
    • Good tutorial
    • Just concentrate on the basics and terminologies ..
  • JSSE
    • Overview:
    • Just get to know how and why SSL is used.

In general, security topics to cover would be

  • Cryptography
    • Symetric Key Cryptography
    • Public Key Cryptography

The above link for JSSE should be good enough to get an overview of the above too..( see “HOW SSL WORKS” in that page…)..

  • Java support for Cryptography: should mention about JCA ( java cryptography architecture..)

 

Here is a good overview doc…for all the above technologies

White Paper from SUN

October 19, 2007

Mashups!

Filed under: Technology, Web Technologies — javywrites @ 1:07 pm
Tags:

A technical word that reads more like a slang expression ! I like this.

Well whats all this about Mashups?.
Mashups are presentation of a new service whose building blocks are smaller services pulled off from different sources.
Check this to get an whiff of how it looks like.

Although the idea is there since long, the usage of the term is gaining more popularity now.
Microsoft has even launched a free tool ( yeah , you heard it correct – FREE & from Microsoft !) called popfly to help develop mashups.

Speaking in GoF language, should I call ‘mashups’ a Decorator pattern or a Facade pattern ?.
Oh!. Wait a min.Where did I keep my Martin Fowlers :)

Here is an article from IBM on the topic.

Blog at WordPress.com.