First glance at Scala

Today I took a first glance at Scala at the Paris JUG monthly meeting. Scala is a programming language which runs on the Java Virtual Machine.
I have not compiled a single line of code in Scala yet but I saw enough code to get a decent idea of it.
When you think Scala, think about the functional programming paradigme. A function can be a value.
The first speaker, Sader Drobi, showed us a few examples of code to illustrate the advantages of passing a function as a parameter.

Continue reading

DAO design pattern in a session bean ?

I have recently been challenged by a colleague with a .Net background about the way I sometimes use session beans in web applications. Indeed, I like to implement DAOs as session beans.
Some people argue that it’s best not to directly implement CRUD methods in session beans.
The main reason being that they prefer to add another level of separation. For instance :

Session bean client
!
Session bean
!
business object helper class
!
DAO
!
ORM (Hibernate)
!
Database

A good example of this approach is the old implementation (EJB 2.0) of the The Java Pet Store by Sun. (API : http://java.sun.com/blueprints/code/jps131/src/).
My opinion is that this level of separation is not always necessary. And I believe using session beans as DAOs makes even more sense now that in EJB 3.x we have the Java Persistence API (entitymanager)  which already provides generic
database access methods (persist(), merge(), etc) :

Session bean client
!
Session bean DAO (JPA)
!
Entity bean
(JPA)
!
Database

Adam Bien explains it well in this post.

Quick chat with Teodor Danciu, the founder of JasperReports

Today I went to the Solutions Linux Open source conference and met the founder of JasperReports: Teodor Danciu. He is Romanian and speaks a very good French.

I had a quick chat with him. First, I thanked him for creating that great reporting library and then I asked him if the generated Excel files are compatible with Excel 2000, being a requirement of the customer on the project i am currently working on. The answer is: check the excel libraries that are used in JasperReports (POI and iText). They are compatible with Excel 2003 for sure.

I quickly discussed with him the support of iReport/JasperReports for EJB-QL queries. And MDX queries against an SQL Server 2008 Analysis Services. It seems a fix is available in the SVN repository and will be integrated in the next release (in 2 weeks) of JasperReports (3.7.x ?)

In the end, he gave me his business card to contact him if needed.

Amazon Carousel Widget to display the books I have reviewed

I just installed this nice plugin that makes it possible to use the Amazon Carousel Widget inside WordPress posts.

Using it now to display the various books I have reviewed during the past few years.

The reviews are listed here : http://longbeach.developpez.com/

Pretty cool, isn’t it ? 🙂

I have also added it at the bottom of the page by editing the footer.php file of the current theme. The code i added in footer.php was generated by the wizard located here :

https://widgets.amazon.com/Amazon-Carousel-Widget/

Generate a report from an SQL Server 2008 Anaysis Services OLAP cube with iReport and JasperReports

Software versions that i used :

iReport 3.6.1
JasperReports 3.7.1
Microsoft SQL Server 2008 Analysis Services
Tomcat Web Server 6.0

I was recently tasked to generate a report through JasperReports/iReport
with data coming from an OLAP cube stored in SQL Server 2008 Analysis Services.

It was rather tricky because it seems there is no default Query Executer Factory that can handle MDX
through the XML/A protocol for SQL Server 2008 Analysis Services.

Continue reading

Executing MDX queries against an SQL Server 2008 Analysis Services database in Java

If you are looking for a quick way to connect to an OLAP / multidimensional database like
SQL Server 2008 Analysis Services, here is the procedure.
Be aware that you need to set up XML/A HTTP access for SQL Server Analysis in IIS first.
Basically you need to load a component that enables data exchanges between a client and SSAS.

Continue reading

I am not a GAE virgin anymore

Well, I do not have much spare time to take a deep look at all the new technologies that come around but i always try to check at least the minimum.

Google App Engine offers a nice tutorial : http://code.google.com/appengine/docs/java/gettingstarted/

I did not run into any major problem.

The result is a very basic and classic guestbook application.

Building and uploading the web application from Eclipse to the App Engine is a piece of cake. You must first receive a code on your phone in order to create an application ID :

GAE_ID

You can see it here :  http://celfertest.appspot.com/

I am looking forward for more fun with GAE in the near future, when I have the time.

Scrum applied to a POC project

I just finished working on a short project where for the first time I used the Scrum agile method.
We needed to create the very first pages of a portal based on a Liferay, a free and open source enterprise portal.
Due to the very short time we had (3 weeks) and which is inherent to the nature of the project (a proof of concept), the scrum master decided to create 3 sprints of 1 week each. Generally, a sprint lasts 3 weeks.
Here are 3 pictures of our white board filled with yellow post-its. Each week we gave a new title to the board : (season 1, season 2, season 3).
Season 2
Our product backlog contains user stories which correspond to the customer’s requirements / needs. We defined 3 level of priorities (P1, P2 and P3) for the tasks.
Scrum 1
We had 4 columns: “PORTLETS”, “PARAMETRAGE”, “TECH”, “DESIGN WEB” representing the categories of the tasks. This is not the conventional way to do it because each column should be representing the life-cycle of a task (for instance the statuses “PENDING”, “IN PROGRESS”, “IN QUALIFICATION” and “COMPLETE” ).
Scrum 2
When a task is done, the post-it moves on to the DONE column (in fact a line at the bottom in our case. Again, not the conventional way to do things).

VMware virtual machine with Windows 7

I have been using VMware workstation and VMware player lately. I am really impressed and it is amazing to see the benefits it can bring. For instance one can load a machine running with all the software needed to do web development.

Today I created a virtual machine from an iso file containing Windows 7, which is in beta version right now and will be on sale in october 2009.

I can run Windows 7 as a guest operating system on my Windows Vista operating system, the host.

The virtual machine can have its own IP and be visible in the LAN.

Rich Internet Application Statistics

This Flex app is an interesting one.

It shows the percentages of deployment of the main RIA plugins (Flash Player for Flex, Silverlight Player for Silverlight, JRE for JavaFX), in real time, based on about 41 sites, during the last 30 days.

Apparently, regardless of the OS and the browser, almost 70% of the desktops do not have the Silverlight plugin yet. I am not surprised, I installed it today only.

On the other side, almost every desktop runs Flash Player (97%).

And 26% of the desktops do not have a JRE.

Seam’s 2 new contexts : conversation and business process

Last night i attended a presentation of Seam and the speaker told us that Seam introduces 2 new types of contexts: business process and conversation.

What do they bring to the four well-known other contexts (page, request, session, application) ?

Here is the answer that the author of Seam in action, Dan Allen, gave me in the Javaranch forum :

The conversation is a slice of the HTTP Session dedicated to a single browser viewport (tab or window). It maps one-to-one with a use case involving a single user, where the boundaries are something you decide based on the business logic. Those boundaries can be set various ways, either declaratively (XML) or programmatically (Java/Groovy/EL). The main purpose of the conversation is to extend the persistence context across more than one request to avoid detached entities. You also have the option of binding the conversation to a stateful pageflow, which makes the boundaries more well defined and constrains the user on a predetermined navigation path.

The business process is a persistent context (i.e., stored in a database) and therefore can stretch across any number of requests, sessions, or even application restarts. It maps one-to-one with a use case involving one or more users. The boundaries are controlled by a business execution language. Seam relies on jBPM to drive the business process described in jPDL. In some regards the business process is a multi-user conversation, though each task in the business process can itself be a single-user conversation. You can start to see how these two contexts build on one another.

Scalability (with Terracotta)

Last night, I attended a meeting about Terracotta and the presenter was the creator, Ari Zilka. Among his slides was what i found an interesting slide about Terracotta’s advantages : scalability and availability.

I reproduced it here. Scalability is a term often used in the computing area.

Writing data in memory is less scalable than writing on hard disks but on the other side data written in memory is more available (in terms of speed access) than data written on disks.

Link: http://www.terracotta.org/web/download/attachments/14155789/fig_104_1_grad.png