tag:blogger.com,1999:blog-20994945342458112392024-03-13T11:27:59.921+05:30Chiradip Mandal<a href="http://www.linkedin.com/in/chiradip"><img src="http://www.linkedin.com/img/webpromo/btn_viewmy_160x33.gif" width="160" height="33" border="0" alt="View Chiradip Mandal's profile on LinkedIn"></a>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-2099494534245811239.post-32939667128696439072009-11-20T20:47:00.000+05:302009-11-20T20:47:42.863+05:30Terracotta quick tutorialI think the quickest way to grasp the concept and get started using Terracotta. Find it here <a href="http://www.frameworkfactory.org/Framework_Factory/Flog/Entries/2009/8/26_Open_source_JVM_Clustering_and_Network_Attached_Memory_using_Terracotta.html">Terracotta quick start</a>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-28006881511583247882009-11-20T19:43:00.007+05:302009-11-20T19:56:44.005+05:30Spring 3 file upload<div><span style="font-family: Georgia, serif; font-size: 16px;"></span><br />
<div>I could not find a consolidated and everything works kind of Spring fileupload example using Spring 2.5.x or 3.x. I have written tested and uploaded it here. <a href="http://www.frameworkfactory.org/Framework_Factory/Flog/Entries/2009/11/19_Spring_2.5.x_3.0.x_fileupload_-_complete.html">Framework Factory blog on Spring 2.5/ Spring 3 Fileupload</a><br />
</div><br />
</div>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-21079325401092078742009-11-02T18:20:00.002+05:302009-11-20T19:57:46.792+05:30increasing tomcat JVM heap size<span style="border-collapse: collapse; color: #3f3f3f; font-family: sans-serif, Arial, Verdana, Helvetica; font-size: 13px; line-height: 16px;"></span><br />
<span style="border-collapse: collapse; color: #3f3f3f; font-family: sans-serif, Arial, Verdana, Helvetica; font-size: 13px; line-height: 16px;"><ul><span style="color: blue;">export CATALINA_OPTS="-Xms16m -Xmx256m"</span></ul></span>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-53178788705293135492009-10-27T09:55:00.003+05:302009-11-20T19:58:08.893+05:30running multiple instances of jboss<div style="font: 12px Helvetica; margin: 0px;">run.sh -Djboss.service.binding.set=ports-01<br />
</div><span style="font-family: Helvetica; font-size: 100%;"><br />
</span>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-11234987444941931862009-08-21T21:26:00.004+05:302009-11-20T19:57:23.394+05:30Openfire 3.6.4 on mac - admin console login issue SOLUTIONI installed Openfire 3.6.4 on my mac and ran into admin console login problem without any 'google' solution. Do not know whether this is a mac only problem. Simply I was not able to log in using the password I provided during set up. Re-setup as suggested by others did not help. The solution ultimately I traded is to switch embedded database to mysql (other non embedded will work too). In order to switch from embedded to mysql I reinstalled open fire but it can be done by re-setup too and is discussed later in this post. Uninstalling is tricky and can be done in this way.<br />
<div><br />
</div><div>==========EITHER=========<br />
<div>Uninstalling openfire on Mac.<br />
</div><div>Remove the files/folders listed below<br />
</div><div></div><div><span style="color: #333333; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="font-family: 'courier new';"><span style="font-size: large;">/Library/LaunchDaemons/org.jivesoftware.openfire.plist</span></span><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="font-family: 'courier new';"><span style="font-size: large;">/usr/local/openfire</span></span><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="font-family: 'courier new';"><span style="font-size: large;">/Library/PreferencePanes/Openfire.prefpan</span></span><br />
</div></span><br />
</div><div><br />
</div><div>Your openfire is kicked (uninstall) out of your Mac.<br />
</div><div>==========OR=============<br />
</div><div>Resetup can be done in this way. <br />
</div><div>open /usr/local/openfire/conf/openfire.xml<br />
</div><div><br />
</div><div>Change the line (hopefully last but one line) <span style="font-family: 'courier new';"><setup>true</setup></span> to <span style="font-family: 'courier new';"><setup>false</setup> </span><br />
</div><div><span style="font-family: 'courier new', fantasy;">==========END EITHER/OR=======</span><br />
</div><div><span style="font-family: Georgia, -webkit-fantasy;">Then open the admin console at </span><span style="font-family: 'courier new';">http://localhost:9090/index.jsp</span><span style="font-family: Georgia, -webkit-fantasy;"> or you can do it in Mac way by opening openfire in System Preference and click on "Open Admin Console". </span><br />
</div><div><span style="font-family: Georgia, -webkit-fantasy;"><br />
</span><br />
</div><div><span style="font-family: Georgia, -webkit-fantasy;">Follow the instructions in the admin console. Select mysql (or oracle or something else other than embedded one) as the database. Provide all the required info make sure you create the database that you specify and credentials are correct. Complete the setup. I was not able to log in using the password I have provided for admin during setup. No worry. Go to terminal and run </span><br />
</div><div><span style="font-family: Georgia, -webkit-fantasy;"></span><span style="font-family: 'courier new';">mysql -u <user> -p<password></password></user></span><span style="font-family: Georgia, -webkit-fantasy;"> and use the database for that used by openfire. Execute this sql command </span><span style="font-family: 'courier new';">update ofuser set plainpassword = 'admin123' where username = 'admin';</span><span style="font-family: Georgia, -webkit-fantasy;"> use password of your choice. Done. Restart openfire from "Openfire" System Preference (you will find an entry 'Openfire' in System Preference) by clicking 'Stop Openfire' button and then 'Start Openfire'. Login to admin console using the changed (in database) password with user name 'admin. Fin.</span><br />
</div><div><span style="font-family: 'courier new', -webkit-fantasy;"><br />
</span><br />
</div></div>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-10947107932210682372009-06-11T19:47:00.003+05:302009-07-14T19:45:11.914+05:30Handy command to see whether a class file exists in your lib/dir<span style="font-family:Comic Sans MS;font-size:85%;"><span class="651255413-11062009">$find ~chiradip/.m2/repository/ -name *.jar -exec jar tvf {} \; egrep 'Spring'</span></span><br /><span style="font-family:Comic Sans MS;font-size:85%;"><span class="651255413-11062009">Another command that does the similar thing</span></span><br /><span style="font-family:Comic Sans MS;font-size:85%;"><span class="651255413-11062009">$for line in `ls *.jar`; do echo $line; jar tvf $line egrep 'Spring'; done</span></span>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-15920652601417016982009-06-11T12:04:00.000+05:302009-06-11T12:05:00.407+05:30Running JPA test cases in Maven<DIV><FONT face="Comic Sans MS" size=2><SPAN class=834121806-11062009>First thing first. The directory structure should look like this.</SPAN></FONT></DIV> <DIV><FONT face="Comic Sans MS" size=2></FONT> </DIV> <DIV> +- pom.xml<BR> +- src<BR> | +- main<BR> | | +- java<BR> | | | +- <SPAN class=834121806-11062009>mypackage</SPAN><BR> | | | | +- <SPAN class=834121806-11062009>My</SPAN><SPAN class=834121806-11062009>Entity</SPAN>.java<BR> | | +- resources<BR> | | | +- META-INF<BR> | | | | +- persistence.xml<BR> | +- test<BR> | | +- java<BR> | | | +- <SPAN class=834121806-11062009>mypackage</SPAN><BR> | | | | +- <SPAN class=834121806-11062009>My</SPAN>PersistenceTest.java</DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2>second thing second ;)</FONT></SPAN></DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2>package mypackage;</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2>import org.junit.Assert;<BR>import org.junit.Test;<BR>import javax.persistence.EntityManager;<BR>import javax.persistence.EntityManagerFactory;<BR>import javax.persistence.Persistence;</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2>public class MyPersistenceTest {<BR> @Test<BR> public void testBasicPersistence() throws Exception {<BR> EntityManagerFactory factory = Persistence.createEntityManagerFactory("myunitname");<BR> EntityManager manager = factory.createEntityManager();</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> String attributeOne = "AttributeOne";<BR> String attributeTwo = "AttributeTwo";</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> MyEntity entity = new MyEntity();</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> entity.setAttributeOne( attributeOne );<BR> entity.setAttributeTwo( attributeTwo );</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> manager.getTransaction().begin();<BR> manager.persist( entity );<BR> manager.getTransaction().commit();</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> MyEntity result = ( entity ) manager<BR> .createQuery("SELECT e FROM MyEntity e WHERE e.attributeOne = :attributeOne")<BR> .setParameter("attributeOne", attributeOne )<BR> .getSingleResult();</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> Assert.assertEquals(firstName, result.getAttributeOne());<BR> Assert.assertEquals(lastName, result.getAttributeTwo());</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2> manager.close();<BR> factory.close();<BR> }<BR>}<BR></FONT></SPAN></DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2>Third thing. Make sure all the dependencies are in the pom like JPA, hibernate, or db pool (c3p0 kind of).</FONT></SPAN></DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2>Thats it. </DIV></FONT></SPAN> <DIV><SPAN class=834121806-11062009><FONT face="Comic Sans MS" size=2></FONT></SPAN> </DIV> <DIV><FONT face="Comic Sans MS" size=2>Regards, Chiradip</FONT></DIV> <DIV><FONT face="Comic Sans MS" size=2></FONT> </DIV>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-18730305122335280162009-05-12T16:04:00.001+05:302009-05-12T17:15:10.712+05:30Resource Centric Service Architecture (RCSA)Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-83971599568393376582009-05-08T12:46:00.024+05:302009-05-12T10:39:22.216+05:30Jersey on embedded grizzly (another tomcat like server) and then on tomcat 6<< It is about JAX-RS - JSR 311. Simply getting up and running with restful webservices quickly> ><br /><<remember running it on tomcat 5.x is a bit different> ><br />First thing first. Lets write the application first. To show the dependencies the library versions that worked for me is listed below in the form of POM file.<br /><br />======================================================================<br />For NON MAVEN USERS: Do not worry about the pom content just look at the dependencies to get the jar files with right versions and this also says that my dev environment is Java 6 but it should work well with Java 5. You may skip the pom if you wish.<br />======================================================================<br /><br />============================<br />POM.XML<br />============================<br /><span class="Apple-style-span" style="font-family:'courier new';"><?xml version="1.0" encoding="UTF-8"?><br /><project><br /><modelVersion>4.0.0</modelVersion><br /><groupId>paperless-client-rest-api</groupId><br /><artifactId>simple-ws-client-rest</artifactId><br /><version>0.0.1-SNAPSHOT</version><br /><description>Simple Client REST Aplis for Java<br /></description><br /><br /><repositories><br /><repository><br /><id>maven2-repository.dev.java.net</id><br /><name>Java.net Repository for Maven</name><br /><url>http://download.java.net/maven/2/<br /></url><br /><layout>default</layout><br /></repository><br /><repository><br /><id>maven-repository.dev.java.net</id><br /><name>Java.net Maven 1 Repository (legacy)</name><br /><url>http://download.java.net/maven/1<br /></url><br /><layout>legacy</layout><br /></repository><br /></repositories><br /><br /><dependencies><br /><dependency><br /><groupId>com.sun.jersey</groupId><br /><artifactId>jersey-server</artifactId><br /><version>1.1.0-ea</version><br /></dependency><br /><dependency><br /><groupId>com.sun.jersey</groupId><br /><artifactId>jersey-client</artifactId><br /><version>1.1.0-ea</version><br /></dependency><br /><dependency><br /><groupId>com.sun.grizzly</groupId><br /><artifactId>grizzly-servlet-webserver<br /></artifactId><br /><version>1.9.9</version><br /></dependency><br /></dependencies><br /><br /><build><br /><plugins><br /><plugin><br /><groupId>org.apache.maven.plugins</groupId><br /><artifactId>maven-compiler-plugin</artifactId><br /><configuration><br /><source>1.6</source><br /><target>1.6</target><br /><!-- <executable>${env.JAVA_HOME}/bin/javac</executable> --><br /><compilerVersion>1.6</compilerVersion><br /><fork>true</fork><br /><verbose>true</verbose><br /></configuration><br /></plugin><br /></plugins><br /></build><br /></project><</span><br /><br />We will have only 2 files to start with a basic and a good and a complete sample<br />======================<br />CODE: The resource class - this class will decide what you get once you access the specific URI. The uri here is /helloworld on the server root. e.g. if your server runs on localhost:9998 then the resource will be accessible at http://localhost:9998/helloworld. If you open http://localhost:9998/helloworld on your browser you will see the message helloworld - of course you have to implement the service - it is just one block away.<br />======================<br /><br /><br /><div><ol><li>package org.paperless.client.rest.example;<br /></li><li><br /></li><li>import javax.ws.rs.GET;<br /></li><li>import javax.ws.rs.Path;<br /></li><li>import javax.ws.rs.PathParam;<br /></li><li>import javax.ws.rs.Produces;<br /></li><li><br /></li><li>/**<br /></li><li> * @Author Chiradip Mandal<br /></li><li> * @Copyright © Chiradip Mandal 2009<br /></li><li> * @License Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0<br /></li><li> * <br /></li><li> */<br /></li><li>// The Java class will be hosted at the URI path "/helloworld"<br /></li><li>@Path( "/helloworld" )<br /></li><li>public class HelloWorldResource {<br /></li><li><br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>// The Java method will process HTTP GET requests<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>@GET<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>// The Java method will produce content identified by the MIME Media<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>// type "text/plain"<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>@Produces( "text/plain" )<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>public String getMessage() {<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>return "Hello World";<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>}<br /></li><li>}</li></ol></div>====================================<br />CODE: The RESTful service goes below. It uses the resource (HelloWorldResource).<br />==================================== <div><br /></div><div><div><ol><li>package org.paperless.client.rest.example;<br /></li><li><br /></li><li>import java.io.IOException;<br /></li><li>import java.util.HashMap;<br /></li><li>import java.util.Map;<br /></li><li><br /></li><li>import com.sun.grizzly.http.SelectorThread;<br /></li><li>import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory;<br /></li><li><br /></li><li>/**<br /></li><li> * @Author Chiradip Mandal<br /></li><li> * @Copyright © Chiradip Mandal 2009<br /></li><li> * @License Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0<br /></li><li> * <br /></li><li> */<br /></li><li>public class Main {<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>public static void main( String[] args ) throws IOException {<br /></li><li><br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>final String baseUri = "http://localhost:9998/";<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>final Map<> initParams = new HashMap<>();<br /></li><li><br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>initParams.put( "com.sun.jersey.config.property.packages", "org.paperless.client.rest.example" );<br /></li><li><br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>System.out.println( "Starting grizzly..." );<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>SelectorThread threadSelector = GrizzlyWebContainerFactory.create( baseUri, initParams );<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>System.out.println( String.format( "Jersey app started with WADL available at %sapplication.wadl\n"<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>+ "Try out %shelloworld\nHit enter to stop it...", baseUri, baseUri ) );<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>System.in.read();<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>threadSelector.stopEndpoint();<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>System.exit( 0 );<br /></li><li><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>}<br /></li><li>}<br /></li></ol></div><div><br /></div></div><div><br />Notice Line number 22. <span class="Apple-style-span" style="font-family:'courier new';">initParams.put( "com.sun.jersey.config.property.packages", "org.paperless.client.rest.example" ); </span>The second part of this line is crucial. This the name of the package where all the resource (classes) will be available, either directly or under subpackage of this package. <div><br /></div><div>Guess what? Just run the the above java and point your browser at http://localhost:9998/helloworld and voila you see the message appears on you browser "Hello World".<br /><br />=======================<br />ENHANCEMENT OF THE ABOVE CODE<br />=======================<br /><br />This is pretty static code. Lets add some dynamism here. Lets say if we access http://localhost:9998/helloworld/print/{myname} - substitute {myname} by your actual name - and we get our name printed on the browser or the caller http client.<br /><br />Lets add the following lines in HelloWorldResource.java<br /><br /><br /><span class="Apple-style-span" style="font-family:'courier new';"><br />@GET<br />@Produces( "text/plain" )<br />@Path( "print/{myname}" )<br />public String getTestReply( @PathParam( "myname" ) String name ) {<br />return "Your name: " + name;<br />}</span><br /><br /><div><br /></div><br /><br />One more thing is done. Lets jump into the next thing - returning a java object. Trick is here - at the server side we can return an object but at the browser or httpclient side java object does not make sense but XML does. Lets see how we can return a java object at the server side to get an XML at the client.<br /><br /><span class="Apple-style-span" style="font-family:'courier new';"><br />@GET<br />@Produces( "application/xml" )<br />@Path( "desc" )<br />public SimpleDescrption getDescription() {<br />SimpleDescrption desc = new SimpleDescrption();<br />desc.setMyDescOne( "My Description One" );<br />desc.setMyDescTwo( "My Description Two" );<br />return desc;<br />}<br /></span><br /><br />You guessed it right. If you access browser http://localhost:9998/helloworld/desc and you will see an XML appearing on your browser or curl or any httpclient.<br /><br />One thing is left the SimpleDescription.java - it is simple just follow me below. It's a simple bean except it is marked as @XMLRootElement and thats it. Remember this marking is must to get this working.<br /><br /><span class="Apple-style-span" style="font-family:'courier new';"><br />package org.paperless.client.rest.example;<br /><br />import javax.xml.bind.annotation.XmlRootElement;<br /><br />/**<br />* @Author Chiradip Mandal<br />* @Copyright © Chiradip Mandal 2009<br />* @License Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0<br />*<br />*/<br />@XmlRootElement<br />public class SimpleDescrption {<br />private String myDescOne;<br />private String myDescTwo;<br /><br />public void setMyDescOne( String myDescOne ) {<br />this.myDescOne = myDescOne;<br />}<br /><br />public String getMyDescOne() {<br />return myDescOne;<br />}<br /><br />public void setMyDescTwo( String myDescTwo ) {<br />this.myDescTwo = myDescTwo;<br />}<br /><br />public String getMyDescTwo() {<br />return myDescTwo;<br />}<br />}<br /></span></div><br /><br />Use your favorite browser (I dont use my favorite browser for this as safari is bad in handling XML output ;) ). The output in firefox is as below.<br /><br /><simpleDescrption><br /><myDescOne>My Description One</myDescOne><br /><myDescTwo>My Description Two</myDescTwo><br /></simpleDescrption></div>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-33458623761698189502009-05-05T23:58:00.012+05:302009-05-08T12:46:32.784+05:30Running 2 tomcats on a single machineVery simple thing but very important and needed many a times. The simple to follow steps.<br />1) Download tomcat and unpack it in 2 different directories. Lets say /sfw/tomcat1 and /sfw/tomcat2 or if it is windows c:\sfw\tomcat1 and c:\sfw\tomcat2.<br />2) Edit the conf/server.xml file in both the tomcat installations and make sure the ports are different. For example if tomcat1 has the following config snippet -<br /><br /><Server port="8005" shutdown="SHUTDOWN"><br />.....................<br /> <Connector port="8080" protocol="HTTP/1.1"<br /> connectionTimeout="20000"<br /> redirectPort="8443" /><br />....................<br /> <Connector port="8009" protocol="AJP/1.3" redirectport="8443"><br /><br />Then tomcat2 should have something like<br /><Server port="8006" shutdown="SHUTDOWN"><br />....................<br /> <Connector port="8081" protocol="HTTP/1.1" connectiontimeout="20000" redirectport="8444"><br />....................<br /> <Connector port="8010" protocol="AJP/1.3" redirectport="8444"><br /><br /><br />Thats it for the basic config.Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-79979143794082952372009-05-05T16:27:00.002+05:302009-05-05T17:01:56.172+05:30Simple BPEL TutorialHere is the link for the article <a href="http://www.objectengineering.org/bpel.html">http://www.objectengineering.org/bpel.html</a>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-74644242876920043362009-05-05T12:03:00.006+05:302009-05-05T12:52:58.850+05:30Spring Framework tutorialHere goes the link of my article <a href="http://chiradip.com/Spring/Welcome.html">Spring Framework tutorial</a>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.comtag:blogger.com,1999:blog-2099494534245811239.post-11875410370509778482009-03-19T12:44:00.005+05:302009-03-21T15:02:42.713+05:30SUN - up for saleThis is inevitable that SUN is looking for selling itself as consecutively 4 quarters they reported loss. I wish I could buy SUN ;) It has huge assets used and unused and lots of stuffs that another company may take decades and billions to recreate. IBM is preying on SUN. I am calling it preying as IBM has that bad boy attitude to acquire and kill the way they did with Rational likes. As a SUN admirer I do not wish to see IBM buying SUN. My solely personal opinion is - CISCO should buy it. I am a CISCO employee incidentally but this is my solely personal opinion. What benefits CISCO may get out this buy out and what we SUN admirers may get.<br />1) CISCO is foraying into server market - if CISCO buys SUN, CISCO can use SUN's mature server ranges along with legendary Solaris. Data center will be sexier than ever with all CISCO+SUN products. <br />2) Virtualization - CISCO needs it and working on it but in my opinion CISCO will take decade to reach what SUN has already reached if at all it reaches there. <br />3) Software development legacy - SUN has sound software development legacy and CISCO can not afford to sale only hardware so this can be inherited from SUN.<br />4) Intellectual Properties - do I need to say anything here!!<br />5) Love - through Solaris and then mighty Java, SUN acquired huge number of lovers worldwide. CISCO may get that love by buying SUN.<br />6) Benefit we (SUN admirers) get - IBM would kill SUN's philosophy if it buys it. CISCO I believe will not, rather will allow SUN to grow on its own and leverage the SUN's deeds and we will still get the SUN flavors undistorted.<br />7) CISCO has strong sales force with very good connections to governments and big industries worldwide. This would play a pivotal role to lift SUN sales up fueling its growth and continuing the R&D thats at the heart of SUN philosophy.<br /><br />If it has to be sold out SUN should consider selling it to CISCO. If at all they can not afford selling it to Chiradip ;)Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com1tag:blogger.com,1999:blog-2099494534245811239.post-62364430539007182582009-03-17T08:28:00.003+05:302009-04-22T18:13:55.131+05:30Soft hardware ;)Software products are getting complex everyday in terms of setting up, configuration, operation and maintenance. What if working on software gives us the feel of working like a well packaged hardware like iPod?<br /><br />What is my definition of soft hardware?<br />1) Of the shelf usable.<br />2) Works with my laptop or desktop or server just upon connecting them.<br />3) No installation of software and no configuration for general use.<br /><br />Examples <br />1) An integrated development environment with 1 or 2 test servers integrated with it (think of websphere integration developer - if you are aware). It is pain to install manage and work daily mainly due to the configuration. Now if that can be obtained in a USB stick and you just have to connect it with your computer and you are all set to go, you can do whatever you want. Not working! just remove the media and start afresh.<br />2) Pre configured webserver on a cardChiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com2tag:blogger.com,1999:blog-2099494534245811239.post-91411130784030487182008-12-28T10:30:00.007+05:302009-05-05T12:55:56.034+05:30Simple EJB3 - A link on Objectengineering ArticleHere goes the link to my article <a href="http://www.objectengineering.org/ejb3.xml">EJB 3</a>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-58064490472017627602008-11-25T16:29:00.004+05:302008-11-25T16:52:25.489+05:30Kicking ESB functions out from the box (read container)Routing and mediation are the important features of ESB and it happens within the container. The ways to communicate and collaborate with outside world (read outside the container) is to have WS interface publishes by a system outside or through different adapters. What can be done for a data collection requirement using ESB? Let me toss a problem; a collection agent - managed by third party proprietary system - collects data, zips it, and stores in a network connected computer in a designated directory. Requirement is to collect the zip files from the designated directory, send to to a processor machine to process the files inside the zip files send the process reports to another central repository and update the database about their URI/URL locations and relationships with collected zips. How can we solve this? how can we fit (?) ESB here? Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-45576452738397115592008-08-08T21:08:00.006+05:302010-07-13T15:22:21.175+05:30JVM level clustering, Network Attached Memory - TerracottaOff late I have found a good JVM clustering solution with certain degree of tolerable intrusiveness. It can wash away many existing datacentre application if implemented carefully. Period. Has CISCO heard it? Incidentally I am a CISCO employee though in this blog I express my personal opinions only and may or may not be aligned with CISCO vision. Read a tutorial on terracotta at <a href="http://frameworkfactory.org/Framework_Factory/Flog/Entries/2009/8/26_Open_source_JVM_Clustering_and_Network_Attached_Memory_using_Terracotta.html">http://frameworkfactory.org/Framework_Factory/Flog/Entries/2009/8/26_Open_source_JVM_Clustering_and_Network_Attached_Memory_using_Terracotta.html</a>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-69122600770092463832008-07-31T20:03:00.005+05:302008-07-31T21:31:55.273+05:30Servlet 3.0 - A comprehensive study and exampleServlet 3.0 is an overhaul to the ageing servlet technology. The features I liked in the servlet 3.0 are:<br />- Making web.xml optional, I really dislike handling 'BOILER PLATE' XML while coding. By using declarative style of programming(To java 5/6/7 people this is pretty old now) it is much easier and fun writing a servlet - bootstrappers will like it much. I will just show you one code snippet using servlet 3.0 that just works.<br /><br /><span style="font-family:courier new;font-size:130%;">package org.objectengineering.exp.servlet3;<br />import javax.servlet.http.annotation.*; </span><br /><br /><span style="font-family:courier new;font-size:130%;">@Servlet(urlMappings={"/foo"})<br />public class MyFirstServlet3 {<br />}</span><br />Thats it. Try it on a servlet 3.0 capable container like jetty 7.0. While writing this post the latest jetty was 7.0.0-pre1. Your servlet writing is over - can't believe ;) - go and deploy it now - you can skip the web.xml part. done.<br /><br />Greg Wilkins proposal for asynchronous servlet is interesting and I am looking for its adoption by JSR expert commitee. The proposal can be found at <a href="http://dist.codehaus.org/jetty/misc/AsyncServlet3.0-draft0.html">http://dist.codehaus.org/jetty/misc/AsyncServlet3.0-draft0.html</a>.Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-45578075689419816422008-07-12T16:01:00.008+05:302008-07-31T19:22:58.270+05:30Spring Integration: the new kid on the block (of ESB?!!)I just started exploring Spring Intrgration just day after it was released - the version 1.0.0.M5. Here I will share my first impression with Spring Integration followed by subsequent trials and experimentations. Enforcement for speration of concerns without being intrusive is something at the core of Spring philosophy and it is further extended in Spring Integration. Not to be vary theoritical but to communicate some important points about Spring Integration - I am directly copying some excerpts from officila Spring Integration reference; those are goals and principles of Spring Integration.<br /><br />Goals:<br />• Provide a simple model for implementing complex enterprise integration solutions.<br />• Facilitate asynchronous, message-driven behavior within a Spring-based application.<br />• Promote intuitive, incremental adoption for existing Spring users.<br /><br />principles:<br />• Components should be loosely coupled for modularity and testability.<br />• The framework should enforce separation of concerns between business logic and integration logic.<br />• Extension points should be abstract in nature but within well-defined boundaries to promote reuse and portability.Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-53254738948231506992008-03-09T15:39:00.002+05:302008-03-09T15:41:58.957+05:30RUP Academy=== lets make this happening ===Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-56958712434443626532008-03-07T20:03:00.002+05:302008-03-07T20:15:21.418+05:30Review: Ten faces of innovation - Tom KelleyI really liked the book, the way Tom described the different aspects and facets of innovation! The facets are - The Hurdler, The Caregiver, The Collaborator, The Cross-Polinator, The Experimenter, The Anthropologist, The Experience Architect, The Set Designer, The Storyteller, The Director. I agree with Tom that to be successful in innovation you have to touch upon most of the facets that he described. For this installment of writing I will talk about 'The Anthropologist'.Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-37119004480863332042008-02-16T12:31:00.010+05:302008-07-31T19:23:32.583+05:30Atom and XMPP based team collaboration and communication platform<p>2 weeks back I started working on a web development project as my weekend project to experiment on Atom & XMPP. Later I was confident to forward-factor the experimentation to a real-valued project that I was thinking for a long time - a seamless team collaboration and communication platform. All the communication and collaboration can be done from just a single page.<br /><br />The business driver behind the idea:<br /><ul><br /><li>Single page team collaboration suite</li><br /><ul><br /><li>Project status, stories and discussions are on the live dashboard – real-time, editable, provokes participation</li><br /><li>Developer friendly way of on-time reporting (consolidation is automatic) – just by setting the status message of your messenger/communicator</li><br /><li>Chat on the page</li><br /><li>Real time discussion on the dashboard – makes other people aware about others activities and provokes for participation. Imagine 2 guys discussing about Hibernate and is on the show on dashboard – can you take a seat back and just ignore it?</li><br /><li>Assign, track and manage tasks – all online</li><br /><li>Manage contacts – nothing new but can’t live without it</li><br /><li>Call contacts</li><br /></ul><br /><li>Reduces the need for email exchange – emails are difficult to track</li><br /><li>Open cultured team collaboration with improved communication</li><br /><li>You are always aware what is happening in your team - no matter who are you (although access rights can be implemented)</li><br /></ul><br />The salient features of this product are:<br /> Feed (Atom with optional RSS support) based project tracking, project story, project discussion, announcements etc. <br /> Presence (XMPP) based reporting – open reporting model <br /> Instant messaging <br /> Task definition, allocation and tracking <br /> Contacts management <br /> VoIP calls (SIP based)Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-68197819312884969482008-01-26T19:15:00.000+05:302008-01-27T23:46:11.893+05:30A weekend with GWT, JavaScript & client-side xml processing using XSLTI wanted a simple, effective, technologically advanced and appealing online test (exam) system for the trainings that I occasionally provide. I had two intentions while developing this - one, to test participants' knowledge in the topics on that I provide training - second, this weekend project itself is a demonstration of 'Assembly Line Software Development' - a post lean method - that I devised to make software development more cleaner and faster.<br /><br />I donated this prototype to TME, Capgemini France - where I work as a Telco Architect in the week days. It will undergo a massive makeup and dressing room session to have more commercial features in order to make it usable for TME certification exam.<br /><br />I used GWT (Google Web Toolkit) - some standard and some advanced features - and some javascript. GWT is fun to use with one disappointing thing - it does not yet support java generics and other Java 5/+ features at the client side. That means it does not have a compiler to translate java 5 specific code to javascript. For the folks not yet exposed to GWT - GWT is a sophisticated Java to JavaScript compiler with some added server side utility-ish features.<br /><br />Let's just see where GWT is useful: GWT allows Java developers to write browser based application that comprises components (GUI stuffs), contents (text, image, xml etc.), events and content manipulation. A Java developer writes this in Java, allowing him/her to develop browser based application in a true object oriented way (more accurately in java way). GWT compiler translates the 'client-side' java code into cross-browser JavaScript code. It also has some server side utility-ish features - naturally that doesn't need to be translated into JavaScript.<br /><br />Some quick start references 1) <a href="http://code.google.com/webtoolkit/gettingstarted.html">GWT official getting started guide</a> 2) <a href="http://www.oracle.com/technology/pub/articles/dubois-gwt.html">A good article on oracle site</a><br /><br />The GWT features used in the the project are given below. I will write about them from three aspects - one - why I have used it, two - a brief note about the feature with reference and three - a note on how I have used it to gain some special benefit/effect.<br /><br /><span style="font-size:130%;"><span style="FONT-WEIGHT: bold">1) RemoteServiceServlet:</span></span><br /><span style="FONT-WEIGHT: bold">Why I have used it:</span> to serve the question set. The question set is in XML. Initially I thought to put it in the public html (equivalent) directory and thought to process them at the client side. I dropped the idea in order to avoid users' sniffing into the the questions as the questions have answers inbuilt to it for instant and easy evaluation. So... I have used this feature to serve question set from server side.<br /><br /><span style="FONT-WEIGHT: bold">Note on the feature: </span>At the the server side there is a service implementation that extends the RemoteServiceServlet and implements the service interface. A good place to have a look into - how to use RemoteServiceServlet is <a href="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.RemoteProcedureCalls.html#CreatingServices">Remote Procedure Call</a>. The catch here is to write an asynchronous interface corresponding to the service interface. Look at the above link content to understand more.<br /><br /><span style="FONT-WEIGHT: bold">How I have used it</span> in online exam module: The service implementation - the extension of RemoteServiceServlet - used to construct questions from XML. A question is a serialized object constructed from the said XML fragment and finally the questions - the serialized objects - put into a list and sent across to the client.<br /><br /><span style="FONT-WEIGHT: bold">A special note:</span> At the server side code you can freely use Java 5/6 features depending on the compiler version you are using that is not possible at the client side code. GWT 1.4.61 - the latest GWT distro - doesn't support Java 5/+ style of coding at the client side. I love using Java 5/+ features very much; specially generics.<br /><br />The below picture is taken from GWT official page.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_KkVNkETKPUSBbhB13w9NmADUhCuJiZt8Z0UMXYmhT4b8bffgGohksh9TLSo-bvTLF98XNUStcqjapYLG2ptff9ASbTYqNDq6VA7pi_7tVqwuHo_t18qVNRd8YB8Jgec8qJhIOMnBvcw/s1600-h/AnatomyOfServices.gif"><img id="BLOGGER_PHOTO_ID_5159996506949818834" style="FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_KkVNkETKPUSBbhB13w9NmADUhCuJiZt8Z0UMXYmhT4b8bffgGohksh9TLSo-bvTLF98XNUStcqjapYLG2ptff9ASbTYqNDq6VA7pi_7tVqwuHo_t18qVNRd8YB8Jgec8qJhIOMnBvcw/s400/AnatomyOfServices.gif" border="0" /></a><br />You can very well enjoy using Java 5/6 features to write server side components shown at the right hand side of the picture. I am waiting to see Java 5 related features in GWT soon.<br /><br />At the client side - you instantiate <span style="FONT-STYLE: italic">YourServiceAsync</span> is special way to get the service instance.<br /><br /><br /><br /><br /><span style="font-family:courier new;">YourServiceAsync yourService = (YourServiceAsync) GWT</span><br /><span style="font-family:courier new;">.create( YourService.class );</span><br /><span style="font-family:courier new;">ServiceDefTarget endpoint = (ServiceDefTarget) yourService;</span><br /><span style="font-family:courier new;">String moduleRelativeURL = GWT.getModuleBaseURL()</span><br /><span style="font-family:courier new;">+ "servletalias";</span><br /><span style="font-family:courier new;">endpoint.setServiceEntryPoint( moduleRelativeURL );<br /><br /></span>Now your service instance 'yourService' is ready and the operations in it are ready to be called. '<span style="font-family:courier new;">servletalias</span>' points the implementation of the Service extending <span style="font-family:courier new;">RemoteServiceServlet </span>and is specified in <span style="FONT-STYLE: italic;font-family:courier new;" ><yourmodule></yourmodule></span>.<span style="font-family:courier new;">gwt.xml</span>. Refer <a href="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.RemoteProcedureCalls.html#CreatingServices">Remote Procedure Call</a> for more clarity.<br /><br /><span style="FONT-WEIGHT: bold">Architectural consideration:</span> Simply pushing most of the processing to the client side, saving the server from crushing large data and perform more operations. There are only two calls between client and server - one - to get the set of questions and another - sending the report back to the server - not for processing but to store for future reference. For a particular exam XML (containing questions) processing is required only once at the server side after that its only functionality would be just to send the set of questions in the form of a list to the client. Efficient and simplistic - is not it?<br /><span style="font-size:130%;"><br /><span style="FONT-WEIGHT: bold">2) UI features:</span></span> This is the most used and most useful set of features in GWT.<br /><span style="FONT-WEIGHT: bold">Why I have used it:</span> To save myself writing JavaScriot codes and making them compatible with different browser families. To be more precious - GWT has been chosen for that matter. Like many others, I am comfortable in writing Java codes, moreover it is easy to detect development time errors and correct them. Debugging is also easier compare to JavaScript debugging.<br /><span style="FONT-WEIGHT: bold">Note on the feature:</span> The UI components are similar to Swing UI components. It is the essence of GWT but very easy to use. Refer the <a href="http://code.google.com/webtoolkit/gettingstarted.html">GWT getting started</a> article on GWT official web page. I am not going to talk much on this as it is standard and available in detail on the official website.<br /><span style="FONT-WEIGHT: bold">How I have used it:</span> In standard way. haha...<br /><br /><span style="FONT-WEIGHT: bold">Special Note: </span>I had tough time dealing with RadioButton. It made me to bang my head several times. What was the problem? The problem was a bit complicated; the behavior of radio button is just as it should be; the problem originated from my special expectation from RadioButton behavior. I used check box for the question that has multiple right answers to show the options and radio buttons for single right answer. Each selection event makes a particular flag 'true' and deselection event 'false'. In check box there are clear selection and de-selection events upon onClick() - so no problem with check box. In case of radio button - there is no event on de-selection as onClick() only can check a radio button but can not uncheck - and this behavior is required. I, then, tried to use onFocus() and onLostFocus(), it seemed to work well but did not; due to the fact when you navigate away from the group where the radio buttons are placed - it fires the onLostFocus() event that is not desirable. Finally I solved this problem with some other way. So be careful when <span style="font-family:georgia;">you are </span>frequently updating any global value based on the events captured from radio button. ;)<br /><br /><span style="FONT-WEIGHT: bold">3) JavaScript Native Interface (JSNI):</span> Very useful, wonderful feature.<br /><span style="FONT-WEIGHT: bold">Why I have selected this:</span> I wanted to process XML with the XSLT at the browser end. GWT does not have XSLT processor API so I had to write a Java Method in JavaScript. Intersting... right!!! Both were new and exciting for me. Please have a look at the code I have written for your quick reference.<br /><br /><pre><br />package com.objectengineering.onlinetest.client;<br />...<br />.....<br /><br />public class OnlineTest {<br />...<br />.....<br />private String xmlString = "";<br />...<br /><br />int generateReport() {<br /> ...<br /> .....<br /> xmlString = doc.toString();<br /> xmlString(); // the native method is called the way a normal<br /> //java method is called<br /> .....<br /> ...<br />}<br />public native void xmlString() /*-{<br /> var xmlDoc =<br /> this.@com.objectengineering.onlinetest.client.OnlineTest::xmlString;<br /> //the global class variable xmlString is called in this way<br /> var win = $wnd.open("","","");<br /> win.document.open("text/xml");<br /><br /> // code for IE<br /> if (window.ActiveXObject)<br /> {<br /> var doc=new ActiveXObject("Microsoft.XMLDOM");<br /> doc.async="false";<br /> doc.loadXML(xmlDoc);<br /> xslDoc=new ActiveXObject("Microsoft.XMLDOM");<br /> xslDoc.async=false;<br /> xslDoc.load("test.xsl");<br /> var outDoc = doc.transformNode(xslDoc);<br /> win.document.write(outDoc);<br /> }<br /> // code for Mozilla, Firefox, Opera, etc.<br /> else<br /> {<br /> var parser=new DOMParser();<br /> var doc=parser.parseFromString(xmlDoc,"text/xml");<br /> var xsldoc = document.implementation.createDocument("", "", null);<br /> xsldoc.async = false;<br /> xsldoc.load("test.xsl");<br /> var xsltProcessor = new XSLTProcessor();<br /> xsltProcessor.importStylesheet(xsldoc);<br /> var xmlObject = xsltProcessor.transformToFragment(doc, document);<br />// var xmlObject = xsltProcessor.transformToDocument(doc);<br /> var htmlDoc = new XMLSerializer().serializeToString(xmlObject);<br /> win.document.documentElement.appendChild(xmlObject);<br /> win.stop(); //required to solve a mozilla javascript bug<br /> }<br />// return htmlDoc;<br />}-*/;<br />}<br /><br /><span style="font-family:courier new;"><span style="font-family:georgia;">The native operation's code should be enclosed within the block comment.<br />That means if there is a method written in Java script - it should look<br />like<br /><pre><access modifier=""><access><span style="FONT-STYLE: italic"><pre>access_modifier native <span style="FONT-STYLE: italic">return_type</span><return type=""> <method name=""><return> <span style="FONT-STYLE: italic">method_name</span>( <span style="FONT-STYLE: italic">argunments</span><arguments><arguments> ) /*-{<br />//your java script code goes here<br />}-*/;<br /></arguments></arguments></return></method></return></pre></span></access></access></pre>If the method i<span style="FONT-STYLE: italic">s </span></span></span><span style="font-family:georgia;"><span style="FONT-STYLE: italic">'aMthoed()' </span></span><span style="font-family:courier new;"><span style="font-family:georgia;">and if the return type is void and no argument then it should look like</span></span><br /><span style="font-family:courier new;"><pre><pre>public native void aMethod () /*-{<br />//<span style="FONT-STYLE: italic">your java script code goes here</span><br />}-*/<br /><br /></pre></pre></span></pre>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com2tag:blogger.com,1999:blog-2099494534245811239.post-59088580597036087482007-12-10T14:37:00.008+05:302008-08-09T17:51:40.105+05:30Assembly Line Software Development - A post lean methodMost of the trendy software development methods stress on either a process or documenting rigor rather than development rigor. Agile methods were able to solve this problem to some extent, but there is still a compelling need to ensure that we deliver the working software on-time with a simplistic and convenient way. Unified Processes and Agile Methods talk about chunk of working software (executable) to be delivered at the end of each iteration. After follwing unified processes, agile processes for quite a long time I have seen them failing - though there are explanations of the failures by the respective methodology advocates. While I was working on methodologies I liked some of the features of many of them and tried to fill the still-existing gaps by something of my own. I am going to list these in a form of principles. At the end I tried to devise a simple to follow and nonintrusive methodology aimed to execute rapid software delivery, which I named Assembly line software development for the time being. Assembly line was sometimes considered to be the wrong metaphor for software development - for me it depends how do we map the subject with the metaphor and I so far I have found 'Assembly Line' as the right metaphor for the way I am going to explain. The principles are not exhaustive so far and have influence from 5 broad sources 1) Guy Kawasaki books mainly 'The Art of the Start', 2) Mary and Tom Poppendieck's Lean Software Development, 3) Agile practices, 4) Unified Processes and 5)Pain of seeing failure in many projects following RUP, XP, SCRUM.<br /><br />Principles:<br /><ol><li>Minimizing the process rigor is one. The process should be simplistic and just to ensure on-time delivery of working software. The process should be simple enough to practice. The simplicity will make the process habitual to the people use it and should not be felt as something intrusive. </li><li>Make meaning: do only those things that makes meaning to its users. It means figure out the way to add value. This is influenced by Guy Kawasaki and Poppendiecks.</li><li>Communicate & Collaborate effectively - use better communication tool that can keep the entire team in sync without disconnect. Traceable wiki, blog and IM comminication is examples of preferred communication and collaboration mechanisms. Team management along with the team should have a good policy and practice of using them regularly. Maven kind of build+management tool is also preferred to be used in collaboration. Some features like site, distributed build management are wonderful features.</li><li>Continuous integration - the heart of agile processes I liked it much - it is fun doing when automated. </li><li>Regular demonstration of working software, unit demo and integration demo - only unit test is not enough to certify 'development done' but a working demo before the review committee is a must. </li><li>Assembly line oriented development where everybody will contribute to one or another assembly line. There can be several assembly lines in tree structure. The root of the tree is the final assembly line and will deliver the final and complete software. Each assembly line will have different time bound slots that is a task to be done by a person - a single task - a single person (pair programming can also be applied). The deliverable(s) of a child assembly line will take part in the parent assembly line or higher in the hierarchy. This is fundamentally different from the concept of iteration or sprint in scrum. It is an open source style software development. This is more of a work pattern recognition from opensource project styles. </li><li>Just start working on the mission even before the goal is finalized. </li><li>Disposable and cooperative component based architecture: Huhh.. we have heard and worked much on reusable components but what is disposable component based architecture?? Well I'll first talk about an analogy and then will try to explain it further. Visualize a modern village, unlike multi-storied township or city-hubs, it has independent houses and bungalows; well connected but independent. The most important point is - that want to point out is - you can dispose an 'independent house' from a 'modern village' without affecting anything in village systems. In this method - I see 'independent house' as the 'disposable component' and 'modern village' as the architecture - the 'disposable component based architecture'.</li><li>Need for a 'real leader', a no-non-playing captain: A real leader is must in this style of software development. A non-playing captain is real no here. A real leader is not who is PMP certified or six-sigma green belt - they may have real value in some other situations/scenarios - but who 'at least' has good knowledge on technologies; technologies to work on and related complementary and competitive technologies. I said 'at least' because in a given scenario domain knowledge might be required, in those cases the leader should be knowledgeable in domain as well. Or at least a person who is keen to learn the domain fast. The leader should be able to drive the team - consider himself as one member - for 'active learning'. More explanation in active learning is given below as one of the principles. </li><li>Active learning: The team should always learn - learn new technologies, related technologies (complementary, competitive), relevant domains... so on.. But while learning the learner should not idly learn rather s/he should learn actively - meaning learning and doing. If it is a technology a proof-of-concept in parallel with learning, for domain - presentation (why presentation? as this method stresses on demonstration - demonstration helps in many ways; proving that you are working, and keeping the team vibrant and fostering a learning culture) of understanding and other tutorials etc.</li><li>Start writing code even before you understood how-to-do fully. A minimum level of what-to-do understanding should be good enough to start immediately,</li><li>Fill up the gap proactively - if any of the party you are depending on is delaying in giving the input about what to do - you must try to fill the gap with your own understanding rather than waiting and wasting long time; meanwhile right escalation must be triggered for the delay. Once you filled up the gap that can be communicated to the relevant/responsible parties to get approval. </li><li>Round table workshop: It is good to sit together in a circular table with laptops and working while having some little discussions; this will keep the team focused on what is being done - i.e. on the delivery. The team members should participate in the table at least for 2/3 hours a day; they can obviously go back to their desk or cabin whenever they feel there is a need for working alone.</li><li>Delay in decision: Like it is in lean method with emphasis on continuous work; meaning - the project team should start working even before the ultimate decision made by various stakeholders about how the software should look like. Here plays the role of situational leaders (explained later). </li><li>Situational leadership: Every team member should be situational leader - and lead the team at the right time. A situational leader is one who drives the team to do right things before the big-bosses has made up their minds.</li><li>A process champion - identified in a round robin fashion - who will make sure the communication and collaboration is happening in a right spirit and all the stakeholders are participationg in it. This is role is kind of evangelist's role, who will encourage people to use right communication and collaboration tools throughout the day.</li><li>Delivering real-value to the community: It is too philosophical, but I think everybody will understand it. Just don't do something for the sake of just-earning fat cash, but do it by delivering real value to the customer and community. </li><li>Build asset - I am not going to explain much about this just follow the way opensource houses build asset.</li><li>(To be re-arrange the above points and continue adding)<br /></li></ol>Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0tag:blogger.com,1999:blog-2099494534245811239.post-63751315057198078902007-12-08T09:42:00.000+05:302008-01-27T10:55:38.042+05:30Hibernate (ORM) Debate - Good or badThere are people those who hate ORM based application. Of course there are reasons for it. Personally I like ORM - again of course for some good reasons. Mostly, the people who dislike ORM, blame it for its performance. Of course there are some performance issues while using ORM - largely due to the paradigm-rift between the two worlds - object oriented and relational. But this issue can be solved - can be solved almost (if not all) entirely. The question now is how easy to solve this problem. We will see this soon in this post. When we talk about its advantages and disadvantages we tend to forget the intention of the ORM tool. To get the benefit - it is to be used in the right context where it is intended to be used. Lets see the right context. Relational technology is good for database i.e. information store, retrieval and management. Over time relational technologies got maturity and stability and most importantly it has become standard and created industry wide standards like SQL. Simply, for database - relational technology is the best - so far. For data centric application - most of the times there is a need for data model and the data model can be well developed with the relational paradigm in mind. I.e. laying out tables and their relationships. There is another important thing - i.e. Objects. Why it is required? Real world better understands objects such as a pen, a chair something that exists in the real world. To deal with real world objects we need domain model or may be in general an object model - rather I would say - it is better to use domain/object model while dealing with real world objects. Now we have two things - one is data model and other is object/domain model - two different paradigms - two facets of application development - and both are important. We need to take care of both of the facets in the direction of their implicit requirements.<br /><br />Hibernate - or a good ORM tool - sits in between these two paradigms in order to connect the best of both worlds - the object world and the relational world - meant to solve two distinctive but related faces of real life applications - object oriented technologies and relational database technologies.<br /><br />The major advantage of using Hibernate like ORM is to let application developers to think about business objects and largely automates the database related stuffs.Chiradip Mandalhttp://www.blogger.com/profile/10894152913162349656noreply@blogger.com0