Saturday, January 28, 2006

EJB3 session visibility

EJB3 started with the claim to reduce the artefacts needed to program with EJBs. Unfortunately if you want to expose a SessionBean locally *and* remotely, you start to either list all business methods in a POJI for the local interface and the same again in an interface for the remote view. If you update the session bean class by a new method, you need to remember to update both interface files (this calls again for generators like Xdoclet ...)

Another variant to acheive the same result is by using the following view pattern:



In this case you only list the business methods in the "Business" interface. IRemote and ILocal are only marker interfaces that just extend the "Business" interface and which carry the respective annotation:


package foo;

import javax.ejb.Local;

@Local
public interface ILocal extends Business {
// empty
}


This way extending the session bean by new methods just means to update one additional file. Unfortunately this yields again four artefacts for this task, which is far from simple.

Are there better ways to do this?

Tuesday, January 24, 2006

LaTeX on Rail

Ever wondered how to graphically represent EBNF?

There are some packages out there that can produce so called Railroad diagrams.

Phillips has a package called Elegant (you can see some examples in this document)

Then there is LaTeX-style rail.sty online, where the results are quite ok as well (the png image is scaled to 600pt in width, so the real quality is better) :



So, how does one read the diagram? For the start form left to right :-) Words in rounded boxes are terminals (i.e. words that you put literally in your code) Words in normal boxes are non-terminals that refer to other diagrams. A construct like in the start with "AVG", "MAX", ... is a switch statement, where you can choose one ot the options. You will see that above "DISTINCT" is a line without a box. This means that "DISTINCT" is optional.
And this is basically all about reading those diagrams.

Unfortunately, this package does not directly know about the 'ususal' EBNF syntax ( AggreagateExpression ::= ....), but uses its own, which looks like the following for the above example


AggregateExpression : ("AVG" |"MAX" |"MIN" |"SUM")
(
(
'DISTINCT' ? StateFieldPathExpression
) | 'COUNT'
(
'DISTINCT' ? IdentificationVariable
| StateFieldPathExpression
| SingleValuedAssociationPathExpression
)
)
;


Perhaps I am going to write some translator between the formats in Perl ...

Thursday, January 12, 2006

Java Magazin - Internet & Enterprise Technology - Buch-Tipps

German Javamagazin has a review of my JBoss book in the current issue and also online.
Sounds good to me :-)

Tuesday, January 03, 2006

Presentation at Hochschule Heilbronn

On 25th of january I will give a presentation at Hochschule Heilbronn. From their website:
Heiko W. Rupp, Autor des ersten deutschsprachigen JBoss-Buches, wird einen Gastvortrag bei uns halten. Thema seines Vortrages im Studiengang Software Engineering: Die interne Architektur von JBoss.
Start 25-01-2006 14:00
End 25-01-2006 15:30
Where A311 - Hochschule Heilbronn