Skip to content

Archive

Category: Enterprise Systems

Packaging

Abstract

Using Eclipse-based rich-clients as stand-alone applications is discussed in many books and articles. In the context of enterprise systems, the software development adopted several paradigms to improve the quality of the overall architecture. This short article describes some issues in packaging the application for using it in the context of enterprise systems.

Architectural Assumptions

Designing enterprise architectures is a standard discipline for IT-consulting companies or freelancers involved in software development. Maybe one of the main characteristics of enterprise architectures is the framework-driven approach of software creation. Thus, the software has to comply certain rules and standards adopted inside the enterprise. In order to simplify such constrained development process, it is common to use an in-house software framework, which enforces the  compliance of the enterprise-internal standards and acts as glue between different technologies adopted as parts of the enterprise architecture.

Using such frameworks has major implications for the software development in general, and especially for the rich client development. The design issues are summarized in the next section.

Usaging an Enterprise Framework

The major goal of the enterprise in-house framework is to simplify the process of software systems development and to enforce standardization among the software systems. This usually includes the following aspects:

  • Domain-specific component framework
  • Methods for master data management
  • Infrastructure services: authentication, authorization, communication, security, printing, reporting
  • Application skeletons and launchers

The more unification and standardization is included inside the framework, the easier it is for a software developer to concentrate on the particular business task and the easier is the maintenance of the software system.

From the previous list, the most interesting part related to RCP packaging and deployment is the existence of the application skeletons and launchers. So, when launching an application, the framework libraries are loaded and executed first and pass the control to the application-specific modules. The advantage of this approach is that infrastructure services can be loaded first, which can be developed and shared among different applications.
continue reading…

helpEclipse Platform provides a help system that can be used during creation of the help content for your application. It is very convenient while used inside of the IDE, but needs a special approach if used in the RCP. This article tries to gather the information which may be useful.

Adding Help Support

Basic preparations

As discussed in Eclipse RCP Book and RCP Articles, the help system is not a part of the RCP-Runtime and should be added separately. The question arises where to add at to? If you follow the best practices for packaging of RCP applications, you should have at least one product and the top level feature defined (See Rule 1 of Chapter 23 of Eclipse Rich Client Platform). The top level feature includes the branding plug-in (containing the product definition) and refer to other features (like org.eclipse.rcp, and your functional features). In order to add the help system, you need to add the org.eclipse.help feature in this list.

Platform help buttons

There are several predefined buttons (actions) you can use for calling the help system. These are:

  • Help Contents
  • Help Search
  • Dynamic Help

In order to activate them from your ApplicationActionBarAdvisor just call:

private IWorkbenchAction helpContentsAction;
private IWorkbenchAction helpSearchAction;
private IWorkbenchAction dynamicHelpAction;

protected void makeActions(IWorkbenchWindow window)
{
helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
register(helpContentsAction);
register(helpSearchAction);
register(dynamicHelpAction);
}

If you want to do the same declarative, you have to create commands that use the following actionDefinitionIds:

  • org.eclipse.ui.help.helpContents
  • org.eclipse.ui.help.helpSearch
  • org.eclipse.ui.help.dynamicHelp

The same ids are required for registration of key bindings (e.G. Ctrl + F1, Shift + F1, F1 on Win32). Apparently, since these actions adjust their status depending on the state of the system and the plug-ins installed, I could not figure out how to force them to be enabled, when installed in a declarative way. Since they are still provided as ActionFactory (which is legacy due to the changes introduced by new Command Framework), they should be further activated from the ApplicationActionBarAdvisor.

Context-Sensitive Help UI Integration

The Eclipse platform provides not only the help system, but also support the so-called Context-Sensitive Help (a very confusing name, because the context is only the widget, and not the data). In the following, it is shown, how the connection between the widgets and the help system can be established.

The big picture

The content already defined in the help system can be pointed at from various places in the your application using the so-called help contexts, which on one hand point to the places in the documentation and on the other hand can be assigned to widgets in the application UI.

Establishing contexts

In order to assign the help context to a widget the invocation of the method PlatformUI.getWorkbench().getHelpSystem().setHelp(Control control, String contextId); is used. The contextId is a full-qualified string constructed from the pluginId and the local context name. The context name should be unique for this plug-in (usage of non-unique ids leads to a merge of different subjects, which is a nice feature, but may be not desired). I prefer to create the convenience method for this invocation:

public class HelpUtil
{
public static void setHelp(Control control, String localContextId)
{
if (localContext == null || control == null) return;
PlatformUI.getWorkbench().getHelpSystem().setHelp(control,
Activator.PLUGIN_ID + "." + localContextId);
}
}

There are also methods for registration of other SWT widgets (Control, IAction, Menu, or MenuItem) in the help system, which can be handled by the overloaded version of the method. The invocation of the convenenience method usually looks like: HelpUtil.setHelp(composite, "newWizardPage") and should be invoked from the createControls() of the correponding element. Please note, that the “newWizardPage” is a local name, and the pluginId is added to it inside of the conveninece method. Widgets that do not get focus should not be assigned context ids, since they will never trigger a context-sensitive help

The declarative part

As usual in Eclipse, there is a declarative part, that connects the context ids, set up in the code with the help pages. The connection is established by a special XML file. In order for the platform to know, where to find the file, there is an extension point (org.eclipse.help.contexts), that you need to contribute to:

<extension point="org.eclipse.help.contexts">
<contexts file="contexts.xml" plugin="de.techjava.rcp.ui" />
</extension>

The file attribute specifies the full path to the XML file containing the context definition. The plugin attribute is optional and declares for which plugin the context definition applies. Please note, that if the plugin attribute is ommited, the context names used in the context definition file will be seen as local to the plugin they are declared in. For example, if you want to support the context-sensitive help in plug-in de.techjava.rcp.xyz then your in-code definition of the context should define full qualified context names like de.techjava.rcp.xyz.context1. Either you use the extension point (org.eclipse.help.contexts) in the plugin.xml of the de.techjava.rcp.xyz plugin.xml, or if you put the usage of the extension point into some other plugin (e.G. central for all help), you must provide the plugin attribute with value “de.techjava.rcp.xyz”. This issue is badly discussed in the help guide and is a little confusing. In the context definition file the contexts are defined as follows:

<contexts>
<context id="context1" title="My first context">
<description>This is a test context</description>
<topic href="path/context1.htm" label="Context1"/>
</context>
...
</contexts>

Wizards and Dialogs

Wizards are used with or without dialog.

The call of the Wizard#setHelpAvailable(true) shows the Help button.
The call of the WizardDialog.setHelpAvailable(true); shows the small sexy round Question button.

References

I found strange problem running wscompile (from Sun’s Java Web Service Developer Pack 1.6) inside Ganymede (Eclipse Version 3.4.1). The run of the wscompile Ant task produce a problem. The build script execution freezes on the wscompile task. It prints the following message on console but then nothing happens.

[wscompile] wscompile ...\env\java\1.4.2_03\jre\bin\classpath-classpath D:\workspaces\general\lib\bla.bo-0.0.1.jar; ... D:\workspaces\general\lib\... jar.0.5.5

In this line, the classpath of wscompile is printed.

The build script uses configured Apache Ant in version 1.6.5. I tried to start it with Java in versions 1.4.2 und 1.6.0.10. Both works in Europa (Eclipse 3.3.x) but don’t work in Ganymede (Eclipse 3.4.x), except for the first run. It seems that Ganymede provides a different handling for Ant scripts. Every first start of an Ant build script produces new “External Tool Configuration” (if not already there). If this configuration already exists, wscompile task doesn’t work!

This means my build script with wscompile task works only once, every first time after deleting the “External Tool Configuration”. I could live with that if I wouldn’t need that configuration. But I need that configuration to use different java version that is the workspace default.

Do anyone know how to fix that?
Here is my task definiton.

<taskdef name="wscompile"
		classname="com.sun.xml.rpc.tools.ant.Wscompile"
		classpathref="class.path.jwsdp"
		/>

and also task usage in the script

<wscompile fork="true" import="true" base="java/class" sourceBase="java/generated" verbose="true" features="documentliteral, wsi, searchschema, serializeinterfaces, explicitcontext" mapping="java/generated/META-INF/jaxrpc-mapping.xml" config="metadata/wsdl-config.xml" xSerializable="true">
	<classpath>
		<path refid="class.path.local" />
		<path refid="class.path.ant" />
		<pathelement path="${java.class.path}" />
	</classpath>
</wscompile>

Comments are welcome.

_MG_6980_MG_6978

Yesterday, the second Adam Bien event in Lehmanns Bookstore took place. Again, the event was a full success. I arrived half-an-hour earlier and got a seat only in the tenth row.
Adam spoke about new features of EJB 3.1 and Glassfish. He showed examples running on a developer build of Glassfish V3, promising that the features will work without exceptions…
Here are some topics, I remember:

  • Singleton Beans: usefull a s a central point of the application, e.G. central cache etc…
  • Async Methods: allows asynchronous execution of time-consuming methods. Especially, it is possible to abort the execution
  • Deploying Beans in WARs: could be helpful for small applications
  • Global JNDI-Namespace
  • No interface view: simplifies the access to beans, if needed
  • EJBCOntainer.getEJBContainer().getContext(): allows external initialization of bean context, which is nice for testing

Later, Adam discussed some Core J2EE patters, that become absolete with EJB 3.1 and others which are still valid.

After the talk, I spoke with Adam about the OSGi as a module architecture inside JEE application, which seems interesting to me.

The pictures are as usual available in my FlickR Gallery.

Marco published a video on Loroma.

JUGHHThe holiday season is over and we can enjoy an event every week. After Maven 2, Eclipse Stammtisch and reasoning on modularity an event on enterprise systems can be visited. It seems that after the last visit on Java EE 5 Hacking Adam want to tell something on Java EE 6 Hacking…

This session will be interactive / openspace like. He will walk through the new EJB 3.1 APIs and explain some interesting stuff as well. It is the logical conduction of the first JUG HH session in May 2008.

Location: Lehmanns Fachbuchhandlung (Hamburg Hauptbahnhof), Kurze Mühren 6, 20095 Hamburg

Date and Time: 16.09.2008, 20:00
Topic: Productive Java EE 6 – Rethinking Best Practices And Bashing On Patterns, Cluster One

Abstract: Java EE 6 is great, but many questions like:

  • Are DAOs dead?
  • Do JSF really suck?
  • Are anemic JPA-entities a best practice?
  • Are XML deployment descriptors legacy?
  • Are EJBs lightweight?
  • How to test EJBs?
  • Is layering an antipattern?
  • Do we need factories?
  • How to integrate with RESTFul services?
  • Is it possible to deploy EJBs into a …WAR?
  • Are “plain old web containers” dead?
  • Services or Objects – what is the way to go?

still remain open. These and many other questions will be discussed interactively with …code.

Speaker: Adam Bien

About the speaker: Java Champion Adam Bien is a self-employed consultant, lecturer, software architect, developer, and author in the enterprise Java sector in Germany who implements Java technology on a large scale. He is also the author of several books and articles on Java and J2EE technology, as well as distributed Java programming. His books include J2EE Patterns, J2EE HotSpots, Java EE 5 Architectures, Enterprise Architectures, Enterprise Java Frameworks, SOA Expert Knowledge, and Struts, all published in German.

As BEA technical director, Bien is also a member of the NetBeans Dream Team; an Expert Group member of the Java Community Process for EJB 3.1, JPA 2.0, and Java EE 6; and involved in embedded Java, Grid, and P2P technology. He currently works as an architect and developer in several J2EE-Java EE Model-Driven Architecture (MDA) and EAI component architecture projects for the Java EE platform and .NET.

Yesterday, as reported earlier a great session on Java EE 5 featured by Adam Bien took place in Lehmanns Buchhandlung in Hamburg. It was a full success, having approx. 100 developers taking part. Adam asked for the experiences with Java EE and it seemed to be a bunch of professionals. The session slides contained only headings, the rest of the story has been done in NetBeans 6.1 and Glassfish. The entire session has been executed on pretty high speed – to be honest, Adam spoke that quick I just could understand. The session took place in the bookstore, that basically sells two types of books: computer and medical. Adam noticed that the shelf to the right of him contained books on psychiatry, and pointed each time he wanted to express that the antipattern leads to…

The Speaker

Regarding the content, Adam focused on two main directions: the basic enterprise patterns and enterprise anti-patterns (this could be a good book title, btw.). General ideas, like support of DRY principle, convention over configuration and IoC, that are on my opinion the greatest achievements of Java EE 5 has been explained in a very plastic way. Especially, Adam really showed, that the bad-artifacts that made J2EE development boring disappeared in Java EE (or may be better to say: can be avoided). The last part of the talk was attended to the nonfunctional activities around the developed software. Adam focused on testing, management, monitoring, performance, etc… It was pretty interesting to see that Java EE community listens to the developer voices and push the technology towards modern, pragmatic and efficient programming platform.

During and after the session one could ask questions around the topics. Adam told a lot during the answers and proved again his excellent expertise in the Java in general and Java EE in particular. I really enjoyed the session and hope that the next one will not let us wait for several years again. Adam spoke about possible JavaFX session – this would be also very interesting.

( more photos in my photostream)

As announced in a previous post, Egon Boerger introduced his current work on Semantical Model of BPMN. The computer scientist, known by most of us through his work on Abstract Sate Machines (ASM), focused in his talk on the try to improve the BPMN with a unambigious and clear meaning. Especially, he showed in a very plastic way, how a formal specification can foster the understanding of a standard like BPMN. In doing so he reveal several weak points of BPMN concerning the meaning of splits/merges. Especially, those become a real problem if you use BPMN like a workflow language.

Egon Boerger The main message of Egon was the need of formal specification and separation of specification from implementation. He showed how this can help in order to define the semantics. I was glad, that he confirmed some statements I’m discussing in my thesis.

Another positive message was that he is in touch with the OMG and SAP guys and his propositions are not only know in academia, but also in the standardization organization like OMG. He reported about some positive feedback from them, and spoke about some contributions to the BPMN 2.0.

I really enjoyed the session, because I like this old-school-style computer scientists. They spread their meta-thinking of a very high level and precision, that sometimes drives us progmatic guyes crazy. In the same time, they establish a natural meaning of quality and foster the reasoning about the topic, we are dealing with everyday…

( more photos in my photo stream)