Tuesday, October 24, 2006

JAXB Examples and Eclipse

To use the JAXB examples in Eclipse I had to add another jar to the build paths: C:\Sun\jwsdp-2.0\sjsxp\lib\jsr173_api.jar since it contains javax.xml.stream.XMLEventReader

Monday, October 23, 2006

Playing with JAXB

I am going through JAXB tutorial http://java.sun.com/webservices/docs/1.4/tutorial/doc/index.html and there are some loopholes that I had to jump over in order to make it work.

For example, here http://java.sun.com/webservices/docs/1.4/tutorial/doc/JAXBUsing2.html#wp87865 it gives not correct commands for compiling and running the primer.

The correct commands (provided that you've installed JWSDP in C:\Sun\jwsdp-2.0) are the following (you should be able to easily rewrite them with using environment variables instead of absolute paths):

Compiling:


Running:


Note the differences from tutorials' commands:
a) putting double quotes around %JAVA_HOME%\bin\javac because JDK is by default gets installed to c:\\Program Files\Java... which has white space in it
b) providing the classpath to the JAXB libraries (I don't know yet which ones of them are truly needed for this exactly exercise, I will learn it later)
c) in compiling I removed the primer\po\impl path - I don't know why it's there now (maybe for other examples?)
d) I copied the Main.java to the root forlder for this example from src folder

The output of this exercise is what was expected:



Very good! This exercise created Java classes from po.xsd and then it read the po.xml to these classes.

So far so good. Let's see what's next in JAXB goodies chest.

Thursday, May 18, 2006

I am on Java One Pavillion

I am now at the Java One Pavillion exhibition in San Francisco. Sitting at a Sun publicly available computer writing these lines.

Boring! Last year it was quite more interesting. Maybe because then I had a specific task to evaluate as many profiling tools as possible and I was set on a target. Today is just a pointless browsing.

Main impression that this exhibition leaves - there is no such thing as Open Source. All the booths are occupied by commercial products that help you develop your stuff faster. Ironically, most of them are still have open source products as their foundation. You can see plenty of products that promise you that you'll be more efficient in developing with Spring, Tomcat, jBoss. And interestingly all these people are quite excited about their products. It seems very strange because living here in Silicon Valley and having so many friends developing in J2EE I don't know anyone who would use these third party solutions. All people use plain vanilla approaches. I even know a guy who is still writing his Java programs in Emacs! But this is a clinical case :))

I've seen an interesting product though. Since currently I am quite interested in UML and how to conveniently integrate it in our designing and development process I stopped at this booth: www.magicdraw.com . The product itself is quite interesting but nothing exciting though. I got a trial version from them and going to spend some time evaluating it. The guy who was telling me about this product is Lithuanian (and their all development is outsourced to Lithuania) - quite young but speaking a very good Russian.

Now I see a booth with bit "Google" on it and I am going to visit it. I wander if they give cool give aways :)

Thursday, March 30, 2006

Notes From Today's BEA Dev2Dev Seminar

TodayI attended BEA Dev2Dev seminar dedicated mostly to their new product BEA Workshop Studio 3.0 (which in fact an acquisition of NitroX). I feel obliged to present here the notes that I took at this seminar because they may have some influence on your future technological decisions. The notes will be quite short though. Also I am not going to give much of comments – just notes. They will be presented in chronological order as they were taken during the seminar.

And so, bear with me: it will be long but, I hope, edifying.

  1. Only one person (out of approximately a hundred) raised his hand on question “Who is using AOP?”
  2. There was a question from the audience “What is POJO?”
  3. BEA is stating that their approach mostly lies in “Blend of proprietary and Open Source solutions”
  4. From the beginning of the seminar there is an accent on POJO and Dependency Injection as opposed to EJB and heavy-weight hard-core J2EE.
  5. Spring is seemingly a new favorite in BEA
  6. Majority in the audience use Eclipse
  7. There are currently two products with the name Workshop:
    1. The one that we saw last year is in fact is not dropped – it is called WebLogic Workshop. In the end of this summer they expect to release the new Eclipse based version 9.2 of it – it will be based on Apache Beehive and use the same concept of “Controls”. It is supposed to be the main instrument for building portals and inter-enterprise integration. It is NOT positioned as an IDE for Java development.
    2. Workshop Studio 3.0 (I guess their marketing team lacks some imagination in naming new products) is formerly known as NitroX. It’s a cross-container IDE for Web development. It was the main topic of today’s seminar.
  8. Many hands were raised on a question “How many people use WL Portal?” WL Workshop is still the only tool for building portals.
  9. MVC topic. Results of poll:
    1. How many people use Weblogic JPF (Java Page Flow, a proprietary concept of WL Workshop)? – a couple of hands raised.
    2. How many people use JSF (Java Server Faces)? – 1 hand
    3. How many people are not using Struts? 3-4 hands
    4. How many people use JSP? Almost everyone ([MG] It figures J )
    5. How many people use Apache Beehive? 3-4 hands (reminder: Apache Beehive is where WL Workshop ideas (JPF, controls) became non-proprietary open source solution)
  10. Struts Tiles are inherently supported by WS Studio. The presentation was using Struts+Tiles
  11. Reminder: WebLogic Workshop and BEA Workshop Studio are two different beasts. The latter is going to be referred as Workshop Studio in this report.
  12. Workshop Studio allows creating Struts Validation rules visually. This process is very intuitive and worked nicely (the error message was shown next to the text field on the page)
  13. In Workshop Studio project consistency validation is done at every step of development (by the means of so called App Xray background Eclipse process) at each layer (dao, IC container, Struts+Tiles, resource file, etc.)
  14. Struts is used in its pure form – everything is done in the “execute” method – no deviations from the standard, no “template patterns”, no proprietary to Workshop Studio overridings.
  15. The mismatch of the Struts Form bean having to be copied over to the POJO and back is still present (well, this is an inherent Struts problem and the Workshop Studio is just a means to use Struts)
  16. Created (and used in the presentation) Struts Action class is looking very much like ours, including:
    1. messages.add(…)
    2. errors.add(…)
    3. saveErrors(…)
    4. return mapping.findForward(…)
    5. It means the refactoring should be minimal
  17. No harm to repeat: everything is going on in Eclipse
  18. JSP editor is not full WYSIWYG – which is very good: no crap in the JSP code (as oppose to SiteMap); visual editing produces very clean code with nice indentation
  19. Although BEA acquired KODO the ORM for the presentation was Hibernate
  20. On my question “What are the proprietary artifacts that are created during development process and would prevent from moving out from Workshop Studio?” the answer was “None
  21. AJAX
    1. It improves user experience ([MG] well, duh!)
    2. It allows validation and processing at the server as oppose to JavaScript spaghetti code
    3. The AJAX development example was nice but there are still no special tools in Workshop Studio for building AJAX apps – we still have to make do on our own.
  22. Enterprise integration should be done at the business service layer ([MG] SOA rulezzz), never at the view layer. Web services are considered the most appropriate and robust vehicle for enterprise integration.
  23. Application developed with Workshop Studio can be deployed on Tomcat, JBoss, WebSphere, Caucho Resin, Jetty
  24. A new product called WebLogic Console Tomcat Server Management – is going to be announced soon. It does management Tomcat from the WL console (funny though technologically exciting, huh!). It allows managing multiple WL servers and multiple Tomcat servers from single console simultaneously.
  25. The underlying technology for this console is JMX
  26. WL (the one that we are currently using) is built using the Portal technology (not Tiles) – all these parts on the WL console are portlets
  27. Developed with Workshop Studio demo app was deployed into Tomcat server using WL console seemingly seamlessly. After that the same app was deployed into WL from the same console.
  28. The blog of the presenter is dev2dev.bea.com/blog/gary_mcbride
  29. Spring.
  30. As I mentioned earlier BEA is in love with Spring and sees it as a viable alternative to EJBs in non-distributed environment.
  31. In fact, I had an impression that this part of the presentation was a definite advertisement for Spring.
  32. Beehive, though could be considered as an alternative to Spring, is in fact an additional abstraction layer which allows wrapping Spring beans as well as EJBs as well as web services as “controls” so that the client becomes agnostic of business service implementation
  33. Spring allows easy unit-testing
  34. Quote. “BEA is blessing Spring. We are fully supporting Spring issues via BEA tech. support.” Unquote.
  35. Maintaining the plethora of Spring Beans is greatly augmented by Spring IDE (an open source product integrated into Workshop Studio) – you can see all the Spring context in a visual representation
  36. Web services can be pretty easily created from Spring beans
  37. Internal BEA rumor: WebLogic web services implementation as it is known now (WL Workshop services and plain vanilla WL web services) might be converted in the future to Axis implementation.
  38. The presentation of building web services from Spring beans was a bit hasty and cramped but it shows that this is quite possible
  39. Hibernate.
  40. Generation of persistent classes and mapping files from the db is pretty easy with Workshop Studio, although there was no mentioning of Java 5.0 annotations for Hibernate
  41. Class diagram of persistent classes (a.k.a. entities) is nicely visualized
  42. “How many people are using JDO?” – Just a couple of hands rose.
  43. “What about Hibernate?” – Plenty of hands rose.
  44. Quote. “You cant’ maintain the plethora of mapping files by hand.” Unquote. That was about using EJB3.0 technology without a proper EJB3.0 visual tool. [MG] I believe it applies greatly to Hibernate.
  45. Workshop Studio allows employing different ORM strategies: JDO, Hibernate, EJB3.0. Most funny – it can be done at the same time.

The End.

Misha

P.S. I promised it would be long. Thanks much to those who could read it through; I hope it was something useful.

P.P.S. The bottom line: if we are to accept the following configuration Spring+Hibernate+Struts we are going to be well off for the foreseeable future.

Monday, March 27, 2006

New Generation of WL Workshop

It looks like the purchase of NitroX was one of the smartest things BEA did in the recent past. Today I spent some time on evaluating its Workshop Studio and I am glad to say that all these problems that were (fortunately) preventing us from moving to the previous version of Workshop are now seemingly in the past.

To start, it’s no longer a black box environment that is doing something for you, doing it great but you have almost no access to what gets generated and you are simply a hostage of this product.

Now everything is based on widely known Open Sores (oops! Slip of the tongue, Open Source) projects: Spring, Hibernate, Struts and seem to head in the same direction as we are moving to. All generated files are the same as we have now, it only augments the process, speeds it up and does lots of consistency verification. And all this without the danger of vendor lock!

These are two very simple short videos that nicely depict how Workshop can speed up the process of creating the domain object layer http://dev2dev.bea.com/downloads/HibernateDemo/HibernateDemo.html and process of Struts/JSP development http://dev2dev.bea.com/downloads/StrutsDemo/StrutsDemo.html .

Speaking of the latter I was amazed how much time could be saved on the process of working with application resource files. Now each change is the resource file requires restarting the server, re-login and re-navigation to the page under development. The Workshop IDE allows visualization of this change in Eclipse environment with no such hassle.

Hibernate mapping is also amazing – we have hundreds of tables that need to be “Hibernated” and without a visual tool it becomes so tedious that almost even defeats the purpose of having Hibernate as a development process performance booster.

Oh, and it was awarded as the Best commercial Eclipse based developer tool at the EclipseCon 2006: http://www.eclipse.org/org/foundation/eclipseawards/winners.php

Seems to me like a good choice.

Wednesday, January 25, 2006

My favorite type of bug (no equals, no hashCode)

I love this bug - you can see that collections collapse on your UI, you go and simply add equals and hashCode methods to your objects that are placed in these collections. Simple and graceful. But when it happened for the first time - it was really nasty to find it out.

Here is a good Eclipse plug-in for building equals, hashCode, compareTo and toString methods: http://commonclipse.sourceforge.net/download.html