22 Dezember 2008

gted 1.5.0 will be released soon

New feature:
--default-domain will be configurable. So the files no longer need to be named messages.po

16 Dezember 2008

Prototyp with NetBeans RCP Started

We decided to use NetBeans RCP for a first prototyp of our new GUI platform.
The main reason behind the decision is that NetBeans RCP is based on Java standards and we hope that it will support all new specs like Beans Binding and Bean Validation in the future.

I hope to publish first experiences soon.

13 November 2008

To RCP or not to RCP

In my current project we are thinking about the use of a new GUI framework.
Unfortunatly I can't find a framework that fits our needs.

Our requirments are:
  • Swing
  • Plugin mechanism
  • Validation
  • Data binding
  • Event listening
  • Eclipse IDE for development
I think the first and the last requirement conflict. So there is NetBeans RCP wich uses Swing but it's not simply possible to develop in Eclipse IDE and on the other hand we have Eclipse RCP but this uses SWT instead of Swing. So none of them are 100% match.
Then I found Java Plugin Framework which looks good. But there is the problem that there are no predefined Extensions to use.

So it's a dilemma! Any suggestions are very welcome!

29 Oktober 2008

Are EJBs Cool?

This is the question in Adam Beans articel on JavaWorld.

And yes they are ;-) But read it yourself.

19 September 2008

New Java Date

In JSR 310 a new Date API will be defined. It is proposed to replace java.util.Date and java.util.Calendar in Java SE 7.

Read on at java.net

18 September 2008

Last Day at Swiss Railways

Today is my last day at Swiss Railways.
After 18 years I decided to look for a new challenge and I found a new job as teamleader at ACS Solutions Switzerland Ltd.

ACS provides ticketing systems for transportation companies all over the world.
In my new job starting on October 1. I will be responsable for a small team of software developers working on the backend system.

The time at Swiss Railways was very interesting an I will enjoy my last day.

28 August 2008

New version of simject without external dependencies

Yesterday I released simject 1.3.0.

From this version simject doesn't depend on any third party libarary or framework.
Commons HttpUtil, XStream and Log4j were replaced by standard Java SE features like HttpUrlConnection, XMLEndoder and XMLDecoder and java.util.logging

This alows to use simject in any environment and it's even more simple.

18 August 2008

gted 1.4.1 with Java 5 support

gted 1.4.0 unfortunately only supported Java 1.6 and above.
I like to aplogise to all Java 5 users!

Now 1.4.1 fixes that bug. You can find more information on gted.org

12 August 2008

gted 1.4.0

A new version of gted is available now.

It adds a highly requested feature --from-code to specify the codepage.

Please help me improve gted by adding feature requests and bug reports on the SourceForge project site.

11 August 2008

JSR 303

Today I found the very interesting JSR 303 Bean Validation.

There is a presentation from Emmanuel Bernard from this years JavaOne which gives a very good overview.

The main idea is to provide annotaions for validaion support like @NotNull, @Length(max=30) etc. This validation will also be used in Java Persistence API to define the constraints and also for the automatic database generation.

01 August 2008

simject 1.1.0 with additonal remoting configuration

In the new simject 1.1.0 release I added some advanced remoting configuration.

By adding either xml: or bin: before the http://... one can definie if simejct should use XStream for XML serialization or if it should do normal Java serialization.

The binary protocol can improve the performance when sending or receiving large objects.

31 Juli 2008

simject new version 1.0.5

I made some Maven2 project refactoring and released 1.0.5 of simject.

Any comments are welcome!

30 Juli 2008

simject 1.0.0 released

Today I released the first version of simject.

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

29 Juli 2008

New OpenSource Project started: simject

During my private studies on dependency injection, JPA, dynamic proxies and remoting I decided to create a very simple dependency injection framework:

simject : SIMple dependency inJECTion

If you don't need a complex, full featured framework like SpringFramework - check out simject!

19 Juli 2008

gted tutorial online

Today I put a gted tutorial online: www.gted.org

It's written by Pavel Mendl. It's great to have a small gted community!
Thanks a lot!

10 Juli 2008

EclipseLink 1.0 available

Great news from EclipseLink: 1.0 is availabe for download here.

27 Juni 2008

EclipseLink no longer incubator project

Tonight EclipseLink graduated from incubator to a "real" Eclipse project.
Congratulations!

EclipseLink is based on Oracles TopLink which was donated to Eclipse. We at Swiss Railways are using TopLink since 2001. Historically TopLink was developed by the The Object People (thats the Top part in TopLink) . Then it was overtaken by WebGain (VisualCafe if someone can remember) and finally after the disappearance of WebGain Oracle took TopLink and made it a part of their application server product. (btw VisualCafe was taken by Borland to get WebGains customers)

Read more on EclipseLink project website

26 Juni 2008

Simon @ Jazoon #2

Yesterday the program at Jazoon was quite ok. Ted Neward held a keynote about "Rethinking Enterprise". He's a great speaker the speech was very enjoyable. The many message was that most people are using some sort of pattern to match new requirements (eg. to a software architecture) with known cases. It would be better to have a higher view to the problem and then to try choosing the appropriate solution.

Then Juergen Hoeller presented the new features of Spring 2.5. In short the main advantage of this release is that you no longer need any XML configuration file. One can do all the config stuff using annotations. (And yes, they do support the common annotations of Java EE!)

Today the keynote was presented by Joshua Bloch. He has finished his new Effective Java Book and talked about wildcards in generics and the correct use of enumerations.
After that Dan Allen held a speech about bijection in JBoss Seam. Very interesting extension of the common dependency injection pattern.

The last session I went in was Adam Biens speech about Glassfish. I must say that from day to day I like Glassfish more, because it's very simple to use and the deployment is quite very fast.

In conclusion this years Jazoon was better than the one last year, but there is a long way to reach the quality of a conference like JAX! But hopefully I'll be there next year...

24 Juni 2008

Simon @ Jazoon #1

This week I'll be at Jazoon in Zurich.

Yesterday (Monday) I was on a tutorial about Glassfish and I was very impressed about this application server. Currently I think, that Glassfish is the most innovative Java EE server on the market.
On Thursday I will visit a session of Adam Bien about Glassfish. More about it then.

Today (Tuesday) there was an opening session with three very interesting key notes. In the first one Martin Odersky held a speech about his programing language Scala. It's a very interesting but in my opinion very academic approach to use Java more dynamic.

In the second key note Simon Phipps form Sun talked about how Java became open source and the benefits of open source software in the hole. This was really a good speech!

The third and last speech was held by Rod Johnson founder of SpringSource (formerly Interface21) and the man behind Spring Framework.
I was a big fan of Spring Framework since 2005. "Was" because in my opinion SpringSource is moving from a very innovative startup building a great framework to a normal application server vendor.
Rod talked about Java EE 6 profile capability. There are three possible profiles:
  • A: Webcontainer eg. Tomcat
  • B: Webcontainer plus JPA, JTA, JSF and some more eg. SpringSource Application Platform or JBoss Seam
  • C: fully featured application server eg. Glassfish
The confusion for me is in the fact, that Rod sayes EJB is useless (he always said that and with EJB 2.1 and earlier I totally agreed!) but in contrast the SpringSource Application Platform uses also a sort of component container: Spring BeanFactory.
Why not use the "standard" component model of Java EE: EJB 3.x?

Comparing SpringSource Application Platform as a member of Profile B to Glassfish as a member of Profile C I think that Glassfish is the better choice. Even if you don't use all the features that comes with it - you will have it on board. Addional to that the newest version of Glassfish is embeddable and it starts very fast.

So I'm curios about the future of Spring and EJB 3.x. Maybe one day they will come together...

17 Juni 2008

First steps with Google App Engine

This evening I discovered Google App Engine.
It's a complete application platform using Python, YAML and some Google API.
With the Google API one can create web applications incl. template engine and persistence and one can make use of the Google users.
It also provides a "Dashboard" where one can configure and monitor the applications.

I followed the tutorial and created my first app a simple guestbook.
My first opinion is, that Google App Engine is a great environment for developing smaller web applications. But I don't have any idea how usefull it will be for bigger applications...

Try it out and let me know what you are thinking!

15 Juni 2008

Heavyweight EJB?

Today I read a post in Adam Biens blog about heavyweightness of EJBs.

His conclusion is that EJB are even lightweight as any other "container" such as Spring, Guice, Pico etc.

And I think his right because the only thing that is really to heavy is the application server and its overloaded functionality! For example IBMs WebSphere with all the possibilities to cluster and and other things that smaller application normally doesn't nead!
But there are better options such as Glassfish.

If I reflect the only feature I really need from frameworks like Spring is Dependency Injection. And this is also provided by EJB3. Additional I need a Persistence Framework such as JPA - but stop - this is also EJB3 and it doesn't matter if I use Spring or EJB3. In contrast with EJB3 I have the Dependency Injection of the EntityManager and this is a big advantage!
Adam writes that Glassfish V3 will be embedable. Then it's no problem to do any JUnit-Tests with my EJBs!

My conclusion is that EJB3 are simpler to use than frameworks like Spring and they have a main advantage: they are based on a standard! So why using any other non standard framework?

30 Mai 2008

Problem with enum in JPQL solved!

Mike Keith solved my enum problem in JPQL.

I forgot to fully qualify the enum. So if the query is correct it works:

String queryString = "SELECT a FROM Address a " +
"where a.addressType = jpa.model.AddressType.OFFICE";

Thanks a lot Mike!

New features in JPA 2.0

Today I had a look at the early draft of the JPA 2.0 spec and like. Here are my highlights of the new features:
  • Added support for persistently ordered lists using OrderColumn and provider-managed ordering column.
    -> Greate! That was really missing!
  • Defined support for foreign key mapping strategy for unidirectional one-to-many relationships.
    -> Very good. It's not very handy to use a relationship table in a one-to-many mapping
  • Added clear method to EntityManager interface to allow entities to be evicted from the persistence context; added CLEAR cascade option.
    -> Bulk Update and Delete will be even more useful
  • Added Cache interface.
    -> I'm not sure if it's a great idea, but who knows...
  • Added support for pessimistic locking and new lock mode types.
    -> I hope JPA will also provide support for SELECT FOR UPDATE
  • Added overloaded find and refresh methods added to support locking with standardized and vendor-specific properties and hints.
    -> Very good, it's no longer required to define an extra query
  • Added standardized hint javax.persistence.lock.timeout for use in locking configuration.
    -> Great idea!
  • Added the standardized properties javax.persistence.jdbc.driver, javax.persistence.jdbc.url, javax.persistence.jdbc.user, javax.persistence.jdbc.password for use in persistence unit and entity manager factory configuration.
    -> Super! It will be simpler to change the persistence provider in standalone environment. And it will be easier for the tools provider to support persitence.xml properties completion.
  • Added Query getNamedParameters and getPositionalParameters methods.
    -> good thing, at least for debugging
I hope there will be more of them in the next version of the spec...

Missing features in JPA

During the past JPA course at the university of applied sciences in Bern I discovered two missing features in JPA:

1. static inner classes in constructor expressions

Example:


// Constructor Expression
String queryString =
"SELECT NEW Outer.Inner(e.name) FROM Employee e";

Query query = em.createQuery(queryString);
List outer = query.getResultList();
for (Outer.Inner inner : outer) {
...
}

Where Outer.Inner is a static inner class in Outer:


public class Outer {
public static class Inner {
private String name;
public Inner(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
}
}

In my opinion this should work. Because I can instanceiate Inner like this:
Outer.Inner in = new
Outer.Inner("Simon");

2. Enumerations in JPQL

For example, this works fine:

String queryString =
"SELECT a FROM Address a where a.addressType = :type";

Query query = em.createQuery(queryString);
query.setParameter("type", AddressType.OFFICE);

But this does not:

String queryString = "SELECT a FROM Address a where a.addressType = AddressType.OFFICE";
Query query = em.createQuery(queryString);

Surprising this works in Hibernate but not with TopLink:

String queryString = "SELECT a FROM Address a where a.addressType = 'OFFICE'";
Query query = em.createQuery(queryString);

I hope this two features will be contained in the next JPA relase!

29 Mai 2008

Only two reasons for declaring an interface

I had several discussions about when it makes sense to declare an interface in Java.

I only found two possible reasons!
  1. If you could have more than one implementation of this interface (I think this is the original intention for interfaces)

  2. If you want to use proxies. (i.e. remoting or dynamic proxies)
In any other cases you should think twice if there is really a need for an interface!
This sounds very simple in a way, but I think this is an important finding.

If you know any other important reason - please let me know!

12 Mai 2008

Even more lecturing

I will start two new courses at the University of Applied Sciences of Bern this Fall.

One will be a database basic course in the Master of Advanced Studies (MAS) in Medical Technology class and the other is an advanced database concepts course for a MAS in Information Technology class.

It will be some hard work to prepare but I'm sure to learn a lot of databases techniques for my daily work!

07 April 2008

Again new version of gted

gted 1.3.0 contains two new features:
  • #1848616: Ctrl + Click on references in source editor
  • #1848621: more than one keyword for xgettext
I hope these are usefull!

06 April 2008

gted project rank 192 at SourceForge

Again gted project is a top 200 project at SourceForge!

Today the statistics shows rank 192 for gted.

Thanks a lot for visiting the website and downloading gted.

03 April 2008

gted 1.2.0 released

After two days I released the next version of gted with the following bugfixes:
#1931731: Plural-Form correctly saved
#1844311: All .po files are merged
#1927276: Whitespaces are now untouched

Now all currently know bugs are fixed. If you find some bugs, please let me know!

Java SE 6 ServiceLoader

Today I had a look at the ServiceLoader class in Java SE 6.

The ServiceLoader is a generic factory that can be configured with a simple file located in META-INF/services. The filename must be the full qualified name of the interface and contains a single line with the full qualified name of the implementation ch.simas.impl.MyServiceImpl.

The usage is also very simple:
ServiceLoader loader = ServiceLoader.load(MyService.class);

for (Iterator it = loader.iterator(); it.hasNext();) {
MyService myService = it.next();
}

Try it out!

01 April 2008

gted 1.1.0 released

Today gted 1.1.0 was released.

It contains fixes for these two bugs:
[1889727] no entry if line number is not specified in the .po(t)

[1886392] msgstr not escaped


Thanks to Zoran for his help!
If you have any comments on gted, please let me know!

30 März 2008

qlb project joined!

On Friday I joined Adam Biens qlb project!

qlb is a utility to generate JPQL queries in a more type safe way.
I will use the the experiences made in this project in my JPA courses.

25 März 2008

Quaere == LINQ?

A few weeks ago I discovered LINQ in C# .NET. This is a very nice lean approach to integrate queries into the language. Here's an example:

var emps = from emp in edb.Employees
where emp.name.StartsWith("S")
orderby emp.name
select emp;

foreach (var emp in emps) {
}


Today I found Quaere that seams to be the same:

Iterable groups = from("city").in(cities).
group(
"city").by("city.getContinent()").
into(
"g").select("g");
for (Group group : groups) {
}
Unfortunately it's far from beeing the same, because LINQ in C# is strong typed! emp in the first example is a variable but city in the second is a string!

It needs a lot of integration in the programing language to achieve the functionality of LINQ as it is done in C#.

Maybe Sun will integrate LINQ as well in Java. We'll see ;-)

So the answer of Quaere == LINQ? is FALSE!

23 März 2008

NetBeans again

It seams that I'm not the only one thinking that NetBeans is a really competitive IDE.
There is a comparison that shows that NetBeans is better in editing and scripting and is easier to use. The main advantage of Eclipse is the huge eco system. But honestly sometimes this can also be a disadvantage, i.e. when you are looking for UML Plugin.

Have a look at the article in Adam Bien's Weblog for more information. There is an other interesting post from Adam: Thinking loud about Eclipse and NetBeans

I totally agree with Adam when he is speaking about the "Plugin hell" in Eclipse. There are too much plugins for the same purpose.
NetBeans comes with the main features for daily use and normally you don't need to install further plugins.

21 März 2008

NetBeans 6.1

A few days ago I downloaded NetBeans 6.1 and I'm very impressed!

I'm a strong Eclipse user but NetBeans has a few features they are extremely useful:
  1. UML Modelling
  2. GUI Builder
These two features (and there are a lot more) makes NetBeans very interesting because these they are really missing in Eclipse and you always have to pay for them. Ok, there are some free UML Plugins, but they are not as good as the NetBeans built-in are.

I will keep on evaluating NetBeans and will blog further findings!

Happy Easter, everybody!

24 Februar 2008

Checked vs unchecked Exceptions

Once again I had a discussion about using checked or unchecked Exceptions in Java.

In my opinion the solution could be simple:
Use checked Exceptions only for business faults. They are part of the interface contract.
But any other Exception thrown by JRE or any other framework should be derived from RuntimeException!

What do you think? Comments are welcome!

10 Februar 2008

Zoran Regvart joined gted project!

Great news from the gted project:

Today Zoran Regvart joined the project! Now we are two people working on gted and we hope to release new and better versions faster and more often!

08 Februar 2008

gted has an active community!

Today the bug 1889727 (no entry if line number is not specified in the .pot or .po) was posted by zregvart. And what a surprise - a patch was attached!

Special thanks to zgrevart. It is great to know that gted has a community!

04 Februar 2008

gted 1.1.0 on track

I'm working on gted 1.1.0 which will contain some major bugfixes.

I hope to release it at the end of February.

05 Januar 2008

New challange starts on Monday

On Monday I will start my new job as head of the MTT team at Swiss Railways IT department.

What's MTT?
  • MTT is the abbreviation for Methodology, Technology and Tools.
  • Goal of this group is to provide coaching, training and tool support in any discipline of the hole software development life cycle.
Why should projects work together with MTT?
  • MTT will help projects to avoid spending time with basic tasks like configuration and build management setup, tool evaluation and process design.
  • MTT will create processes, templates, best practices and most important connect people.
How can MTT connect people?
  • Because the team of MTT knows a lot of people at Swiss Railway and knows about their skills, MTT is able to bring specialists together to solve the problems in a project.
  • MTT will try to enthuse people for the spirit of MTT. Only if people can see and feel the advantage MTT will succeed!
There will be a lot of hard work and I hope to achieve my aim!

If you have any comments or suggestions, please let me know.

And if you have a similar function in your company it would be great to share your experience and to exchange best practices, processes etc.

04 Januar 2008

New Website persistence.ch

For my JPA course at the University of Applied Sciences in Bern, Switzerland I created a new website: persistence.ch

There you can find some information about Java Persistence API and a lot of links to JPA implementations and other useful resources.

The section containing the scripts is protected. You can write an email to the address below and I will send you username and passsword.

Also if you have any comments, don't hesitate to contact me: simon@persitence.ch

03 Januar 2008

Happy New Year and News from gted

I wish you a happy New Year and all the best for you and your family!

Currently I'm working on the feature requests and bugs. I hope to release the next version by end of February.

If you have some comments or requests on gted, please let me know!