Part of my company‘s job is to create tailored software for clients. They manage to deliver 5–6 a year and producing each one takes between 200–500 days. For the last 2 years they have developed around 80% using the .Net platform and the remaining 20% using Java. Last year I worked for 1 month with a .Net team trying to re-architect their software, but I gave up. Those guys didn‘t know what a Singleton was, nor a framework, nor even a package ! And because I didn‘t know anything about .Net (and still don‘t) I moved to do other things. The other day I was talking to one of the commercial guys and I asked him why my company wasn‘t putting any effort in trying to do more Java. The answer was quick and precise: “We realized that .Net software is 40% cheaper than Java“ (understand faster to develop for the same price). I was about to argue, bring the technical side, the big mistakes that I spotted during my little experience with .Net, talk about the Java community, the open source framework, the well designed architecture I‘ve worked with and so on. When I realized that he was a commercial guy, wearing a suit and a tie, I had the divine inspiration that made me reply: “God created the universe, the planet and Man in just 7 days. And you can see the mess. Imagine if he had 40% […]
Sometimes, your job is really boring. And I’m not talking about a couple of hours or a day, I’m taking about weeks and even months of boredom. This can be due to several reasons: the project is delayed, the client has not really made up his mind, the budget has not been approved yet, the compliance team is still checking that the JDK 1.3 can be installed, let’s prototype all the MVC frameworks first… But the most common reason is political issues: everybody is waiting for a decision maker to do his job, take a decision. In the meantime, what can you do: Change the situation: the first thing to do is to try to change the situation. Make things go faster, talk to the right people, send emails explaining how this situation could be improved… In one word, be constructive. Most of the time, this is completely utopist because you don’t have the power to make things move on. Shorten your days: if you can, shorten your painful days. Arrive at 10:30am at the office, have a nice long lunch with your bored colleagues and leave at 4:30pm. Cut the morning and the afternoon with coffee breaks. Work on something interesting: there is nothing better than feeling useful, so, work on something you like: your own project or be part of an open source one (plenty to do on sourceforge). To make things easier, buy a portable hard drive […]
J2EE has nothing new happening ! J2EE is a back-end language ! JCP is too heavy ! Java language is not open sourced ! Ruby on Rails is the next thing ! JRuby looks interesting ! Java is dead ! .Net is easier to develop than Java ! Ruby is more flexible than Java ! J2EE is too complicated when you want to do web development ! And what about PHP ? This is what we can read here and there in blogs, articles, web sites. I have to admit, I’m starting to get confused too. I arrived at the early stages of Java, coming from C and C++, and I thought that was great. When J2EE arrived I was the first one to say “this is cool, developers will have to focus on business requirements rather that wasting time with technical issues that will be held by the server”… and so on and so forth. Unfortunately, J2EE has become so complex that developpers have to read tones of specs and design patterns before developping a simple web app. And what about Ruby, and what about Rails, and what about COBOL ! Maybe like me you have coffee breaks, and maybe like me you work in big companies who have developped their system 30 years ago in Cobol. These companies have started to move to, so called, new technologies. But of course, there are still millions of lines of code […]
In this blog I explain how I’ve migrated from Struts Tiles to SiteMesh in a AppFuse 1.5 project. I wanted to do that because I was fedup of dealing with Tiles aliases and also because I’ve used SiteMesh in other projects and it’s really easy to use. Metadata filter-mappings.xml In %ROOT%metadatawebfilter-mappings.xml add the folowing <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> <!-- These are needed by Tomcat 5 for forwards --> <!--dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher--> </filter-mapping> filters.xml And in the filters.xml file add. <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> struts-actions.xml Change all the actions parameter from Tiles to path to JSP pages. For example, change from <action path="/login" type="org.apache.struts.actions.ForwardAction" parameter=".login"/> to <action path="/login" type="org.apache.struts.actions.ForwardAction" parameter="/WEB-INF/pages/login.jsp"/> struts-plugins.xml In the %ROOT%metadatawebstruts-plugins.xml delete the reference to Tiles plugin <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-config.xml" /> <set-property property="moduleAware" value="true" /> <set-property property="definitions-parser-validate" value="true" /> </plug-in> Action source code The most painful job is to change all your xDoclet tags so that actions forward to a page and not a tile. So you have to change all action classes that are in %ROOT%srcwebmyappwebappaction for example, refering to your tiles-config.xml, change @struts.action-forward name="architectures" path=".architectures" to @struts.action-forward name="architectures" path="/WEB-INF/pages/architectures.jsp" The other problem that you may find is if you have used tiles.Controller. If yes, just change them to struts actions. JSPs First, change your %ROOT%webcommontaglibs.jsp file. Delete <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> and add <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%> <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%> Layout to decorator You have to copy and rename the Tiles layout from […]
I’ve just downloaded Skype 2.0 beta with video. It’s fantastic. I’ve got half of my family in Portugal and half in Australia, so I am a big Skype and Skype Out user. The problem was the video. I had to use Yahoo Msg as well as Skype. But now, with the version 2.0, the video works pretty well I have to say. I was quite impressed. You can even have a full screen image of your friend, while speaking normaly. And it’s just a beta version… I can’t wait to have the final version.
Imagine that you have a Customer object that has an Address and a BankAccount. In other words, John lives in Los Angeles and has the bank account number 123456 (V1.0). Imagine then that John decides to move to New York (V1.1) and several months later changes bank accounts (V1.2). Tired of the city stress, he moves to Alaska (V1.3) where he closes his bank account (V1.4) and starts fishing. How do you keep all this information in your system ? How can you get V1.2 of all your object ? You never delete data, you add version numbers when you make updates, add a timestamp, a version to your class definition (imagine that the Customer class has changed and has different attributes) and, of course, lots of data manipulation and processing to be able to visualise your objects at a certain version. A couple of years ago I worked on a project that had these exact needs : we couldn?t delete any data but instead version it (versioning becomes tricky when there are several layers of associations and inheritance between objects). The other important requirement was that the versioned data was not accessed very often. Because of that we decided to use something not really efficient but easy to develop : JRCS. What we did was very simple : we marshalled the Customer objects (and its relationed Address and BankAccount) into an XML stream (using Castor), we used JRCS to […]