Tag Archive for 'namespace'

First Release Candidate Available

We have just released the first release candidate of Spring IDE 2.0.

We are proud to announce that the first release candidate of Spring IDE 2.0 has been released. Read the announcement in the Spring Framework support forum.

The release candidate is available immediately from our developer update site at http://springide.org/updatesite_dev. Please take some time for testing and provide feedback on any errors, bugs or problems you might find. Many thanks to all that already provided feedback and bug reports. The feedback is really valuable for us.

Spring IDE 2.0 contains lots of new features and a bunch of bug fixes. A list of all closed tickets is available in our ticketing system; currently 222 tickets have been closed. For those of you that are not familiar with recent development of Spring IDE here is a compiled list of features included in RC1:

  • Support for Spring 2.0 namespace-based configurations. We have put lots of work into that to make the support as extensible as possible. You can read more about that in another post.
  • Support for Spring Web Flow, including an extension to WTP’s XML editor for content assist and hyperlinking as well as validation and graphical editing. More information is available here.
  • Tools for Spring AOP based development. This includes support for validating configurations (parsing of pointcut expressions) and visualization of cross cutting references based on <aop:config> and @AspectJ-style aspects.
  • Support for Spring JavaConfig M2. This serves as sandbox for testing the extension points of Spring IDE’s core. Read more about that here and here.
  • Usability and UI improvements: A new Spring Explorer that replaces the Beans View, Content contribution to the Eclipse’s Project Explorer, a Spring Working Set type to reduce cluttering in the Project and Spring Explorer, Refactoring participants for rename and move refactorings of Java Packages and Classes as well as Bean names, New Project and Spring Bean configuration file wizard.

Besides these features, 2.0 RC1 ships preliminary support for Eclipse Mylyn (aka Mylar) that should work with latest Mylar 2.0 developement build. We are planning to adopt to the API changes due to the Mylar project renaming as soon as a new development build is available; presumingly within the RC2 timeframe.

The next (and hopefully last) release candidate is planned for next week and the final version of Spring IDE 2.0 should be available around SpringOne 2007.

Watch out for more; there is still lots to come…

Refinements for NamespaceHandler Utility Classes

With the release of version 2.0.5 of the Spring Framework the API of some namespace-related utility classes has been improved. Here are the related entries from the changelog.txt:

Changes in version 2.0.5 (2007-05-07)
------------------------------------- 

Package org.springframework.beans
* added overloaded "rootBeanDefinition" factory methods with bean class name
  (instead of Class) to BeanDefinitionBuilder
* added “getBeanClassName” template method to AbstractSingleBeanDefinitionParser,
  as alternative to “getBeanClass

#

These two changes allow implementing custom Spring 2.0 configuration namespaces without relying on class loading within the BeanDefinitionParser implementations. That is required if you want your namespace to work with Spring IDE.

More information on implementing tooling-friendly namespaces is available in an older post.

Most Useless Custom Namespace Ever

I was in London the other day to meet with Dave from Interface21 and two colleagues of mine (cheers to Scott and Lucas). One topic of the meeting was related to domain modeling. During the discussion we tried hard to come up with a decent name for a component in our domain model, but couldn’t figure out a descriptive name that would serve our needs well enough.

We were playing around with different names and - you know how that happens during meetings that take the whole day and you start loosing track for a couple of seconds - we started to look for names in other languages than English.

That moment I thought about a custom namespace that is properly the most useless one can think of: A translation of the Spring beans XSD into other languages. This idea sounds like non-sense in the first place, but on my way back at the Heathrow airport I couldn’t resist to think about it in more detail. Finally I ended up scratching a rapid prototype that allows to write bean definitions in my mother language:

<?xml version="1.0" encoding="UTF-8"?>
<bohnen xmlns="http://www.sfw.org/schema/beans-german"
    xsi:schemaLocation="http://www.sfw.org/schema/beans-german
    http://www.sfw.org/schema/beans/spring-beans-german-2.0.xsd"
>

    <bohne id="pet1" klasse="org.springframework.beans.Pet">
        <eigenschaft name="name" wert="kitty1" />
    </bohne>

    <bohne id="pet2" klasse="org.springframework.beans.Pet">
       <konstruktor-arg wert="kitty2" />
       <eigenschaft name="spouse" ref="pet1" />
    </bohne>

</bohnen>

Still, I don’t really see how a translation of the Spring beans XML configuration dialect into other languages can be useful for anyone, but there is already a request for translating Spring’s Exception message to other languages somewhere on the forums.

So what is the story of the post then?

There is one aspect of the preceding example, which I overlooked at the beginning, that could actually become quite useful. As you can see in the example there is not a single XML element from the original Spring dialect used to wire up two Beans. Certainly the syntax looks quite the same as plain Spring, but that is only an example. Even the root beans element is not used.

I wasn’t aware of the fact that with using Spring 2.0 namespaces you can introduce your own DSL to configure components without being tied to Spring’s XML syntax in any way. I haven’t seen a namespace example before that doesn’t use the beans element at least at the root level.

Consequently Spring allows mixing configuration files with different syntax in one ApplicationContext. So you can use a configuration file for your domain services or repositories that uses a Domain Specific Namespace and others for your technical infrastructure services, like transaction or security, that leverage the power of Spring’s XML syntax.

That could be very handy if you are working on a project that applies pattern following DDD. Furthermore that shows how flexible the Spring container is in terms of XML configuration since the introduction of custom namespaces with version 2.0.

The prototype source code of the German namespace handler is available here.

Adding Support for Custom Namespaces

Since version 2.0 Spring supports an XSD-based configuration approach that allows integrating your own DSL for configuration into Spring. How to implement such namespace extension has been documented and the approach has been adopted by several Spring sub-projects and others, e.g. Spring Web Flow and DWR.

In response to an issue in our ticketing system and some comments I got recently, I’m going to introduce Spring IDE’s extension points for plugging in support for your own configuration namespace. These extension points allow you – as a custom namespace developer – to add support for navigation, content assist and validation to Spring IDE.

Continue reading ‘Adding Support for Custom Namespaces’

Editor support for Spring 2.0 and the p namespace

After reading Rod Johnson’s blog entry that introduces a shortcut syntax for specifying Bean properties, I thought that it is about time to give an update on our progress to support Spring 2.0 features in Spring IDE’s Beans XML Editor.

At this year’s SpringOne Rod Harrop first showed me the shortcut syntax and I immediately thought that people will want support for that in their favorite IDE. I prototyped the support for this in the Beans XML Editor a couple of days after SpringOne and forgot about it. Until reading Rod’s post…

Therefore I’m able to provide a preview for this nifty feature right away. The Beans XML Editor will provide content assist for adding p: attributes.

For attributes that are suffixed with -ref - indicating a bean reference - the editor will provide content assist proposals for bean references.

This support will be part of version 2.0 of Spring IDE. If there is some demand I should be able to release a developer preview of the editor, that supports Spring 2.0’s AOP and the p namespace, around The Spring Experience later next week.