The Flex, Spring and BlazeDS full stack on Adobe Developer Connection

The last part of the reedition of my article series about Flex and Spring has been published on the Adobe Developer Connection. This episode is the last one in this improved series so if you haven’t read it yet on my blog, I think the version I gave to ADC is better.

Episode 1
Episode 2
Episode 3

Enjoy!

MobiMap 1.0-RC2

I just released version 1.0-RC2 of MobiMap library. Amongst the features I’ve added are:

  • better icons for screen controls
  • better support for touch screen devices with a new zoom slider
  • all strings are now internationalized in French and English
  • a help screen with all the active shortcuts when you hit 5 numeric key
  • it is now possible to customize all shortcuts programmatically

More information on the official site.

And if you want to test a demo application using MobiMap component, just point your mobile browser to http://mobimap.epseelon.org/mobimap.jad

We’d love to hear your feedback.

MobiMap First Release Candidate is Out

We needed a reusable mapping component for TagSpot development, and we wanted it to be Open Source so that everyone can reuse it and improve it for the general interest. There was no such library available on the environment we’re working on so… we made it!

And here comes MobiMap. MobiMap is a library that offers a reusable and customizable mapping component for several mobile platforms. Today, we’re releasing the first release candidate for version 1.0 of the JavaME version. We’re still working on porting this library to Windows Mobile and iPhone environments, and we’ll release the final version of all three libraries at the same time. Until then, we need feedback from mobile developers and we need help to improve the library.

The project website is on http://mobimap.epseelon.org
Out support forum is on http://groups.google.com/group/mobimap
Our issue tracker is here: http://bugs.epseelon.org
MobiMap’s Subversion repository is here: http://svn.epseelon.org/mobimap-javame

Special Thanks go to…

First I would like to thank developers of Pyx4Me and Microemulator, thanks to which we could develop this library on the Mac.

I would like to thank Romain Guy, Richard Bair and the whole SwingLabs Team: MobiMap component is heavily inspired from JXMapViewer Swing component.

Special thanks also go to Antoine Jacquet, aka Royale, whose blog article about tile providers really helped me a lot in understanding all the tile APIs.

And last but not least, thanks to the whole TagSpot team for their help and support.

Finally, if you want to see what MobiMap can do on your phone, you can type the following URL on your phone: http://mobimap.epseelon.org/mobimap.jad. Or if you’re just too lazy to type this URL and you know how to use a QRCode, you can use the one on the right.

Be careful though, as MobiMap will download quite a bit of map data over your mobile connection so…

My OSGi Learning Path (Part 1)

I’m more and more convinced that OSGi is going to change the way we develop enterprise applications. In a sense it’s funny because it’s been around for a while in embedded and client-side environment, and it’s only been reaching to us server-side developers for a few months. I think that the fact that the most popular Java component framework, ie Spring, jumped in with Spring OSGi (now Spring Dynamic Modules) has a lot to do with this new awareness. That and the growing interest for modularity and reusability encouraged by the Service-Oriented Architecture fashion. Yes, I agree that SOA has become yet another buzzword encompassing everything and nothing, depending on what software vendors sell to their naive customers. But if customers are ultimately willing to believe false promises, it might be because there is a gap in current technologies. Some see this gap as an opportunity for sales, developers see it as an opportunity for technology improvement. And I really see OSGi as THE technological answer to that and many other problems. Yes, OSGi might be server-side development’s 42!

Now, once you realize the importance OSGi is going to have in the years to come, the question is… sorry, the questions are why, what and how? Of course you could read the entire OSGi specification, but it would be like using a bulldozer to plant a flower. Fortunately for us, there are plenty of articles, blog posts and documents out there to help us understand how to deal with our delicate flower. Here is a possible learning path that will take you through a journey in OSGi world, why it’s useful, what it is, and how you can use it in your own projects.

Why is OSGi interesting?

Kirk Knoernschild wrote two excellent blog posts with sample code that is as simple as it can be and really gives a practical idea of what OSGi is all about.

  • The first one introduces the notion of a service in OSGi
  • The second one shows how you can really decouple the interface and its different implementations and dynamically switch from one implementation to another one
  • What I really like about those articles is that they use no external tools like Maven or Eclipse. Just plain text and Ant to compile. Just one thing that can be useful: you might want to download the latest version of Felix (1.0.4 at the time of this writing) and customize osgi/HelloWorld/config.properties (lines 31 to 34):

    felix.auto.start.1= 
     file:/Library/Apache/felix-1.0.4/bundle/org.apache.felix.shell-1.0.1.jar 
      file:/Library/Apache/felix-1.0.4/bundle/org.apache.felix.shell.tui-1.0.1.jar 
     file:/Library/Apache/felix-1.0.4/bundle/org.apache.felix.bundlerepository-1.0.3.jar
    

    Those are my own modifications because I downloaded Felix and installed it in /Library/Apache/felix-1.0.4 on my Mac. And of course you will have to adapt startfelix.sh (or startfelix.bat) as well:

    java -Dfelix.config.properties=file:./config.properties -jar /Library/Apache/felix-1.0.4/bin/felix.jar
    

    Finally, in the second article, at the time of this writing there is a mistake in the code of the manifest for service2. I’ve left a comment and hopefully Kirk will fix his code in the repository. HelloWorldSpec/service2/META-INF/Manifest.mf should look like this:

    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: Hello Service Impl 2
    Bundle-SymbolicName: helloserviceimpl2
    Bundle-Version: 1.0.0
    Bundle-Activator: com.extensiblejava.hello.service2.impl.HelloServiceImpl
    Import-Package: org.osgi.framework, com.extensiblejava.hello.service
    

    Then, following those two articles, Kirk modified HelloWorldSpec to integrate Spring Dynamic Modules and show what it brings to the table. More specifically, you can see that Spring Dynamic Modules makes it possible to externalize service registration and consumption in Spring configuration files and have service and client classes as simple POJO’s.

    That’s it for the “why?”. I guess you understand why it can be interesting to use OSGi on the server-side by now. In the next article, I’ll try to give you a few links to identify what elements can make up your OSGi development environment.

Flex, Spring and BlazeDS: the full stack! (Epilogue)

Thanks to Brian E. Fox, I managed to avoid duplication of Flex remoting configuration files in this project. It requires a bit of additional configuration and I hope that Maven will soon provide a simpler way to do this simple resource inheritance thing. But in the meantime, this one will work.

I’m going to update my fourarticle series to include those modifications, but for those of you who have already gone through it before the update, here are the exact modifications you need to make to the project you got at the end of Part 4.

Flex, Spring and BlazeDS: the full stack! (Part 4) [updated]

[UPDATE] This article series has been reedited on the Adobe Developer Connection. For more information, see this post.

In the previous articles in this series, we did the boring stuff of setting up Spring, Hibernate and MySQL on a sample todo list server on one side, and we wrote a small useless Flex UI on the other side. In this article, we’re going to write the final UI and connect it with the Spring backend using BlazeDS. Let’s go!

Maven, Flex and GraniteDS: another full stack!

For those of you looking for alternatives, it appears that the main diffuculty I had with Israfil’s maven-flex2-plugin, that is how to specify the contextRoot compiler argument, is not really a difficulty after all. I don’t know if it works with BlazeDS, but the guys behind Igenko apparently made it work with GraniteDS. I have to thank Tim O’Brien for pointing that out.

Their solution to the configuration file duplication is at least as ugly as mine, but if you’re looking for the right configuration for israfil, you can try that:

<plugin>
	<groupId>net.israfil.mojo</groupId>
	<artifactId>maven-flex2-plugin</artifactId>
	<version>1.3</version>
	<extensions>true</extensions>
	<configuration>
	<flexHome>${flex.home}</flexHome>
<dataServicesConfig>../igenko-backoffice-server/src/main/webapp/WEB-INF/flex/services-config.xml</dataServicesConfig>
		<main>Index.mxml</main>
		<useNetwork>true</useNetwork>
		<debug>true</debug>
						
		<extraParameters>
			<parameter>
				<name>compiler.context-root</name>
				<values><value>igenko-bo</value></values>
			</parameter>
		</extraParameters>       
	</configuration>
</plugin>

Maybe I’ll give it a shot after I finish my series. But anyways, Adobe if you can hear me, it becomes urgent for you to propose an official and well-documented Maven support for Flex 3.

Flex, Spring and BlazeDS: the full stack! (Part 3)

[UPDATE 2] If you are still having version issues with the sample application featured in this article, you can get a fully upgraded version here

[UPDATE] This article series has been reedited on the Adobe Developer Connection. For more information, see this post.

In the previous article in this series, I described the creation and configuration of a classic standalone Flex module built with flex-compiler-mojo. In this article I’m going to describe the creation of our back-end module, made up with Spring, Hibernate and MySQL. I’ll keep the most interesting part for the fourth and last episode, that is how to connect the frontend with the backend using BlazeDS.

Flex, Spring and BlazeDS: the full stack! (Part 2)

[UPDATE 2] If you are still having version issues with the sample application featured in this article, you can get a fully upgraded version here

[UPDATE] This article series has been reedited on the Adobe Developer Connection. For more information, see this post.

In the previous article of this series, I laid the ground for what will be a step-by-step tutorial about creating a Flex/BlazeDS/Spring/Hibernate project. In this article, I will go into more detail about the creation of the Flex UI for our Todo List application.

Flex, Spring and BlazeDS: the full stack! (Part 1)

[UPDATE 2] If you are still having version issues with the sample application featured in this article, you can get a fully upgraded version here

[UPDATE] This article series has been reedited on the Adobe Developer Connection. For more information, see this post.

In this article series, I’ll try to give you a step-by-step process to create an application with Flex/BlazeDS/Spring/Hibernate/MySQL architecture, all of that built with Maven. I’ve been looking for such a tutorial for a long time, but you know what Gandhi said about the change you wish to see in the world, right? So I finally put all the parts together, and with a little help from a Brazilian friend, tadaaaa! Here it comes!

But before we dive in to the hard stuff, just a few words of caution:

  1. The project that we are going to build in this tutorial is by no means perfect, especially in terms of Maven configuration. So if you have suggestions to improve it, they’ll be warmly welcome.
  2. One of the main ingredients of this project, one without which nothing would have been possible, is the flex-compiler-mojo from Velo. There are other Flex building Maven plugins out there, but at the time of this writing, none of them offers enough configuration options to build this project. On the other hand, Velo’s plugin is still in alpha, so… Anyway, if like me you are convinced that Adobe’s official Maven support is necessary, feel free to vote for this issue.

Enough blah-blah, let’s move on to the real thing. Ready to get nasty?