Escaping quotes in Java

Here is a simple tip to replace a quote with a backslash and a quote : ‘ ==> \’ public static String echappeApostrophe(String s) { String temp; temp = s.replaceAll(“‘”,”\\\\’”); return temp; } I needed 4 backslashes To better understand what is happening here, i printed out a few values : String a = “\’”; … Read more

Design approaches

Here is another memento I wrote to remember the different approaches when writing EJB 3 or Web services. TOP DOWN BOTTOM UP IN THE MIDDLE EJB 3 Develop entity beans first then derive db schema Develop db schema first and drive upwards to create entity beans from your schema Create entity beans and db schema … Read more

Aggregation and composition in Java

I usually forget the differences between the composition and the aggregation relationships and mix them together, so here is a memento that i will share with everyone. Composition : a filled diamond Aggregation : an unfilled diamond The relation between a car and a tyre is an aggregation because the tyre is still a tyre … Read more

Selenium

Today I discovered a useful testing tool, written in Javascript and HTML. One can quickly make functional tests with the Firefox plugin Selenium IDE. If your web app runs on IE, just export the sequence of tests into either an HTML file or a Java file. Here is a screenshot of some testing i did … Read more

Web trend map 2008

The coolest gift for geeks, the A0 poster of the 2008 Web Trend Map (841mm x 1189mm / 33.25in x 46.75in), is now up for grabs: http://informationarchitects.jp/web-trend-map-3-get-it/ http://informationarchitects.jp/start/ http://informationarchitects.jp/ia-trendmap-2007v2/

MappingDispatchAction: a single Action class but several action tags

The MappingDispatchAction class extends org.apache.struts.actions.DispatchAction. It is similar to DispatchAction, except that a different action form, identified by the name attribute, can be specified for each action mapping. MappingDispatchAction: Use this when you want to define multiple form handlers for the same Action. DispatchAction: Use this if for any reason you don’t want to define … Read more

The difference between MVC 1 and MVC 2

The MVC architecture : Model : Responsible for the business domain state knowledge View : Responsible for a presentation view of the business domain Controller : Responsible for controlling the flow and state of the user input There are 2 models of the MVC architecture : Model 1 (MVC 1) and Model 2 (MVC 2). … Read more