18 Dezember 2009

Article on Java EE 6 from Dirk Weil

On JAXEnter Dirk Weil published an article about Java EE 6 which was released as final on December 10th.
http://it-republik.de/jaxenter/artikel/Java-EE-6-auf-einen-Blick-2759.html

He (and also I do) hope that the disrepute of J(2)EE will disappear because Java EE 6 is really a lean framework with just everything you need to develop an enterprise application.
In my opinion frameworks like Spring are no longer needed if you can use a Java EE 6 compliant application server like Glassfish 3 or JBoss 6.
And even the backing beans of JSF can be avoided with EJB 3.1 now. Read more about that topic:
http://www.adam-bien.com/roller/abien/entry/ejb_3_1_killed_the

16 Dezember 2009

Great Article why to use Java EE 6 from Adam Bien

In his most recent post Adam Bien descibes 9 reasons why Java EE 6 is a lightweight and investment protecting solution for building scalable enterprise applications.
I completly agree with these arguments and hope that many developers will continue or start to use Java EE.

9 Reasons Why Java EE 6 Will Save Real Money - Or How To Convince Your Management

If you live in Switzerland and want to learn about Java EE there is a great course at the University of Applied Science in Bern.
CAS Enterprise Application Development Java EE

21 Oktober 2009

NetBeans toString() Generator in Plugin Spotlight

We are proud to announce that since Monday our toString() Generator plugin is listed the current plugin spotlight on NetBeans.org.

29 September 2009

Create Custom JSF Facelet Component

Because it took me a while to find the right steps I don't want to hold back my findings:

1. Create a facelet taglib:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
    <namespace>http://unibe.ch/tags</namespace>
    <tag>
        <tag-name>publikation</tag-name>
        <component>
            <component-type>unibe.PublikationComponent</component-type>
        </component>
    </tag>
</facelet-taglib>


2. Add taglib to web.xml

<context-param>
  <param-name>facelets.LIBRARIES</param-name>
  <param-value>/WEB-INF/facelets/publikation.taglib.xml</param-value>

</context-param>

3. Add component to faces-config.xml

<component>
  <component-type>unibe.PublikationComponent</component-type>
  <component-class>ch.unibe.search.ui.PublikationComponent</component-class>
</component>


4. Implement Component. (I just extended UIOutput for my purposes):

public class PublikationComponent extends UIOutput {

    private PublikationTO getPublikation() {
        ValueExpression ve = getValueExpression("item");
        if (ve != null) {
            return (PublikationTO) ve
                    .getValue(getFacesContext().getELContext());
        } else {
            return null;
        }
    }

    @Override
    public void encodeBegin(FacesContext context) throws IOException {
        final ResponseWriter writer = context.getResponseWriter();
        PublikationTO publikation = this.getPublikation();
        if (publikation != null) {
            writer.startElement("p", null);
            for (AutorTO autor : publikation.getAutoren()) {
                if (autor.getId() == null) {
                    writer.writeText(autor.getName() + ", "
                            + autor.getVorname(), null);
                    writer.writeText(" ", null);
                } else {
                    writer.startElement("a", null);
                    writer.writeAttribute("href", "result.jsf?autorId="
                            + autor.getId(), null);
                    writer.writeText(autor.getName() + ", "
                            + autor.getVorname(), null);
                    writer.endElement("a");
                    writer.writeText(" ", null);
                }
            }
            writer.writeText("(" + publikation.getJahr() + ") ", null);
            writer.writeText(publikation.getTitel(), null);
            writer.endElement("p");
        } else {
            writer.write("Fehler");
        }
    }
}


5. Use your component

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:unibe="http://unibe.ch/tags" template="/template.xhtml">
    <ui:define name="content">
        <h1>Resultate</h1>
        <h:dataTable id="items" value="#{search.results}" var="result">
            <h:column>
                <unibe:publikation item="#{result}" />   
            </h:column>
        </h:dataTable>
        <h:messages layout="table" style="font-size:12px;" />
    </ui:define>
</ui:composition>


That's it ;-)

11 September 2009

NetBeans toString() Generator Version 0.3.0

Thanks to Christians help we could release a new version of the toString() generator for NetBeans. You can download it here.

Please also find the release notes on the NetBeans plugin portal.

Currently we just have all features of Eclipse 3.5 toString() generator implemented.
You can find out what keeping us busy in JIRA.

Any feature requests are highly appreciated!

09 September 2009

Chrisitan Pervoelz joined NetBeans toString() Generator Project

Today Chrisitan Pervoelz from Berlin joined the Kenai project nbtostring
Welcome to the team!

With his help we will able to release faster new versions. Today we release 0.2.0. It contains two improvements: 1) existing toString() well be overwritten 2) you can choose how the toString() is generated (String concatenation or StringBuilder)
Download 0.2.0

07 September 2009

First very basic version of toString() Generator for NetBeans released

I was faster than expected and released a first version of the toString() generator. It is very basic in the moment but I'm working on it to add all features of Eclipse 3.5 toString() generator.

nbtostring in the News

Today my NetBeans toString() generator is mentioned in the German news of JAXenter.

I will try to hurry and release a first version next week.

03 September 2009

Open Source Discussion in Swiss Government

In the last few month there were several discussions about open source usage in government or educational sector in Switzerland. Even the parliament is discussion about that topic.
My question in this debate is if the parliamentarians now what open source really means?!

A lot of people think that first of all open source software is free respectively that closed source software isn't free of charge. But both expectations are wrong!

If we have a look at the Java EE application server market we see that some vendors like JBoss or Sun have open source licenses but if compare them the whole package with support, patches etc. with vendors with closed source licenses there is sometimes not a big difference between these two.
That's an important fact, because if you have problems with the product in production you are dependent on patches from the vendor. And you wont get these if you don't pay for it!

As a conclusion if you are just a user of the software and are not able to change or even read the code, there is no difference between open and closed software.

Don't get me wrong, because I'm a big fan of open source and collaborate in several open source projects but keep my argument in mind if you discuss with "non IT people".

Your opinion is highly appreciated.

25 August 2009

NetBeans toSting() Generator Plugin: Project Started

The toString() generator in Eclipse Galileo is very good.
Unfortunately in NetBeans this functionality is missing.

That's why I decided to start a Kenai project:
http://kenai.com/projects/nbtostring

Creating code generators in NetBeans is very easy. There is a project template that will create everything to start. Now I will have a look how Eclipse implemented the toString() generation.

24 Juli 2009

Two Weeks with NetBeans 6.7

Because of Adam Biens Java EE patterns and best practices project on Kenai i started to use NetBeans 6.7.

In earlier days I had a bad impression of NetBeans. I thought it was slow and so completely different compared to Eclipse. Maybe it was my age making it harder to switch from on IDE to another ;-)

Now I started a new project and decided to use NetBeans and Maven2. I used it very extensively during the last weeks.

And I'm impressed! The integration of Maven2 in NetBeans is really great! It doesn't create additional project configuration it simply uses the pom.xml!

On the other hand I mostly used JUDE UML for UML modeling. But with NetBeans it's no longer necessary to use an external tool because there is an UML plugin that really works! Even the synchronization with the source code is not to bad.

Compared with Eclipse NetBeans feels like an Integrated Development Environment and not like a platform with some plugins in it.

After this time with NetBeans I will go one working with it. But I will use Eclipse for my "legacy" code.

08 Juli 2009

Google Chrome Operating System

What I always expected becomes true!
Google will develop his own operating system called Google Chrome OS.
Read more in the offical Google Blog.

02 Juni 2009

JPA Constructor Expression Quiz

Assume the following query with constructor expression:

SELECT NEW jpa.to.ContainerTO(p, e.name) FROM Employee e JOIN e.phones p

Question: What is the Type of p in the constructor expression?

1. Collection of Phone
2. Object
3. Phone
4. none of the above

The correct answer is 3!

I would like a collection of Phone because that's what I expected and what the navigation to e.phones tells me. But in reality it returns a cartesian product of Employee and Phone which means that I have to care myself.

I asked Mike Keith and here's his answer:

The spec defines identification variables such that they represent instances, not collections.
When you alias a JOIN the alias represents each instance of the collection, so in your example "p" represents each phone in the collection (for each row in the cartesian product).

There is a section in Chapter 4 in the spec on "Identification Variables" that explains this if you like going to the spec for reference.

Thanks a lot to Mike for his clarification!

25 Mai 2009

Java 6 Annotation Processor API

In JPA 2.0 the Java 6 Annotaion Processor API will be used to generate the meta model.

Today I found a nice introduction to this Annontation Processor API on java.net. Read on.

21 Mai 2009

@Inject Posted to JCP

Today Bob Lee et al. posted the proposal of @Inject to JCP.

In the updated version they for see some additional XML configuration to tell the injecter what it should inject. That makes it much saver in bigger environments.

That's what I always had in simject. I don't trust the magic of some other DI frameworks when they do some auto injection.

05 Mai 2009

Dependency Injection Standardized

Today Bob Lee (founder of Google Guice) announced the proposal for a java specification request (JSR) to standardize the annotations for dependency injection. Google and SpringSource will collaborate in this specification.
This spec will help to make DI portable and framework independant. simject will for sure base on this spec ;-)

28 April 2009

gted 1.5.4 with Advanced Domain Support

In gted 1.5.4 the --default-domain setting is now used all over the gted tools integration.
Which means that it's now longer necessary to name .po and .pot files messages.po or messages.pot.
The filename will be the same as --default-domain value.

Please let me know if you have more features that you like to have in gted!

20 April 2009

Oracle Buys Sun!

Today Oracle announced the acquisiton of Sun! Read offical news.

What does this mean to the Java community?
First Oracle has no one of the biggest open source databases in his portfolio: MySQL!
In the past few month Sun always compared the TCO of MySQL with Oracle.
What will be the postion of MySQL for Oracle?

From the Java language side I think it doesn't matter wether Oracle or IBM owns Java because both are mighty players in the Java Community Process.

On the operating system side maybe Oracle can enhance the status of Solaris as the standard OS for Oracle.

I'm very currios what will happen during the next few month...

14 April 2009

Where Does the Eclipse Code Comes From?

Currently there is a debate about the future of Eclipse.

Did you ever wondering where the code of Eclipse comes from?
On the Eclipse Company/Project Dashboard you find the answer.
Around 50% of the code comes from IBM!

For me that's no surprise because IBM was the initiator/founder of Eclipse.

Maven How-Tos

There is a post in the Sonatype Blog which summarizes very useful how-toes for Maven.
A must for every Maven user!

Have a look.

08 April 2009

Google App Engine with Java Support

A while a go I wrote about my first steps with Google App Engine. This was a quite impressive experience but I don't really like to program in Python.

Now Google provides Java support for the App Engine. Read more

07 April 2009

8 Simple Ways to Improve Typography in Your Design

Antonio Carusone wrote an interesting article about typography improvement. Read his article

01 April 2009

JPA 2.0 Proposed Final Draft

Spec lead Linda DeMichiel describes in her blog all the new features.

Specially the Criteria API will change the way queries could be exposed:

For example:
QueryBuilder qb = em.getQueryBuilder();
CriteriaQuery q = qb.create();
Root customer = q.from(Customer.class);
Join item = customer.join(Customer_.orders).join(Order_.items);
q.where(qb.equals(item.get(Item_.product).get(Product_.productType), "printer"))
.select(customer.get(Customer_.name));


You may wonder what Customer_.orders or Oders_.items is. This comes from the new Metamodel API also introduced in JPA 2.0. The classes with the prefix _ contains alle the meta information of your entities which looks like that:

import javax.persistence.metamodel.*;
@TypesafeMetamodel
public class Customer_ {
public static volatile Attribute custId;
public static volatile Attribute name;
public static volatile Set orders;
...
}


Together with the Metamodel API the Criteria API becomes no type save!
This comes very close to .NETs LINQ! Which in my opinion is a big step for JPA!

24 März 2009

Do you know all HTML Tags?

Glen Stansberry wrote an article about 10 rare used HTML tags.

To be honest I didn't knew any of these ten tags and I use HTML since more than 12 years!

22 März 2009

How to build a performing dream developer team

In Computerwoche there is an interesting article about a session that Adam Bien held on the OOP conference.

For the most part I agree with the conclusions.

My experience shows that one of the most important fact is to have people how speak the same language. And with language I don't mean English or German. I mean the way they think, work together etc.

If you have a team member who is not accepted by the team or does not follow the team rules he should not stay in the team. Because the team spirit is at risk and the project can fail because of one inacceptable person.

What's your experience and what did you do if you had some one who didn't fit into the team?

17 März 2009

How to Improve Web Typography

Mindy Wagner posted a very interesting post about improving typography on websites:
5 Simple Ways to Improve Web Typograph

I will for sure adapt his proposals to my websites!

13 März 2009

11 März 2009

Google Android

I found a very interesting article in German from Konrad Hübner and Henning Böger about Google Android on JAXenter.

When I have time this spring I will for sure try Google Android and I hope that in a the near future there will be smart phones available in Switzerland!

10 März 2009

JPA TopLink and Cache

Most of the JPA implementations are using one or more caches to improve performance.
Wonseok Kim describs in his block the behavior of TopLink Essentials.

Reading this article gives you a good idea how caching could affect the behavior of your application.

09 März 2009

Proposals for Java Language Changes: Project Coin

In Joseph D. Darcy's Sun Weblog one can find a list with the proposals for project coin.

In my opinion there are some very useful extensions like Lightweight Properties proposed.

Have a look and let me or better Joseph know what you are thinking.

08 März 2009

Scrum Tools

For all of you how are using Scrum there is a list and reviews of current Scrum Tools.

Check it out!

23 Februar 2009

simject and JSR 303 Bean Validation

Currently I'm working on a new feature to inject the Validator of JSR 303 Bean Validation using the @Resource annotation. e.g.
@Resource
private Validator validator;

I think this is useful extension, because in my opinion JSR 303 will become a very important part of the Java API in the future.

11 Februar 2009

Eclipse e4 0.9M1 released

The first milestone of the next Eclipse generation e4 is out now!
They are rebuilding Eclipse to make it a better application platform and enable it for use in web applications.

28 Januar 2009

Version Control for Solo Developers?

In his post Ernie Leseberg describes the advantages of version control even for small to one developer teams.
I never thougth about that before! Because in my opinion it's common to use version control and it doesn't matter how big the team is! We have year 2009!

Jetty Proposed as Eclipse Project

The popular web container Jetty is proposed to be an Eclipse project. Read more.

13 Januar 2009

gted 1.5.0 released

Today I made a new version of gted. It includes to new options for xgettext and msgfmt:

  • #1993779: .pot file name as option
  • #2500775: Added -r option for Java output.
    Thanks a lot to Martin for his patch!

07 Januar 2009

Public Review of JSR-303 Bean Validation Started

You can find the spec on the JSR page.

Because Bean Validation will have impact on how validation is done in Java EE it contains a section about integration in JPA 2.0. There will several changes related to the DDL generation. See the extract of this proposal:

The list of constraints that must be understood by persistence providers are as followed:
  • @NotNull should be considered equivalent to @Column(nullable=false) / @JoinColumn(nullable=false)
  • @Size.max should be considered equivalent to @Column.length for String properties
  • @Digits (which contains integer and fraction) should be considered equivalent to @Column.precision = integer+fraction, @Column.scale = fraction for decimal columns
Persistence Provider should optionally recognize and try to apply the following constraints as well:
  • @Min / @Max on numeric columns (TODO String too?)
  • @Future / @Past on temporal columns
  • @Size for collections and array (not sure it is feasible)
JPA 2.0 will become even better!

01 Januar 2009

Happy New Year!

I wish you all a successful new year!

Personally 2009 will be a big challenge for sure! There will be a lot of work on my new job and maybe there will be some surprises...