It can be hell to find out the right dependencies to include with different application servers. Use this pom as an starting point if you're developing with Seam on WAS (shows the use of 2 different profiles, one for JBoss and the other one for WAS)

Did you know that the average turnaround time (for deploy/redeploy) of a typical web application is about 1 minute? This sums up to almost 1 month a year (of pure waste)!
That's a completely insane amount of waste.
And don't forget the effort/time that's necessary to pick up "where we left" when the application is running again after staring at the console for a small while.
So, how can put the redeployment torture to an end?
Deploy the application in exploded format
You can package view templates and other types of GUI resources and just hit "refresh" but it doesn't work for classes so it works partially.
OSGI modules
By dividing the application in smaller modules we can speed up the turnaround time. Less code has to be deployed but still we have to wait and there's a degradation cost.
Web framework class loaders
For example, Seam supports incremental redeployment of JavaBean components. That's pretty nice but it doesn't work for entity classes (plus several other limitations) so it works partially. I think Tapestry does something similar.
JVM Hotswap
Running an application in debug mode you can "reload" changed classes. Works OK as long as you only make changes in method bodies (no new methods, no new fields). On top of that it's too slow so it's not really a solution
JavaRebel
I attended a Devoxx presentation about this product and was impressed.
It installs as a JVM plugin (-javaagent) and works by monitoring the timestamp of class files. When it is updated (e.g. when a developer saves a class from the IDE) JavaRebel will reload the changes to class code and structure while preserving all existing class instances.
Check http://www.zeroturnaround.com/javarebel/
I've actually tried this and it works both for JavaBean components and entities. Cool! Of course ot also works for any Java SE application. Goodbye redeployment pain.
For example for JBoss all you have to do is add the following line to run.bat
set JAVA_OPTS=-noverify -javaagent:javarebel.jar %JAVA_OPTS%
And after copying the javarebel jar file to /bin you are ready to start your application and enjoy zero turnaround glory
![]()
The Slip is NiN super cool new album. In addition to being a great release, The Slip is released with a Creative Commons license - which means you can share the album with your friends, put it in your podcast or remix it.
I have found a couple of amazing "remixes" of some of tracks included in Year Zero (previous release) and The slip which you can download here.
The Slip can be downloaded here here (requires email registration). Read a review here
Many of the songs from NiN's latest realeases are available for download as multitrack audio files so it's easy to create your own versions of the songs. Check out what other people are doing att http://remix.nin.com/
See this amazing video.
An old colleague of mine, Joakim Sundén has written an excellent blog post on the importance of reading books (ok, from the point of view of a software developer). It's in Swedish but very nicely written and I can only agree with what he says. What baffles me is that so few developers in this industry read something (other than their own code). Few read articles, blogs or other people's code. And even fewer read books. I know, time's scarce. We all have families, hobbies, etc. Agreed. But if that's the case, then you should do it on your free time. If you are a person who is interested in a 9 to 5 job, I recommend that you have a career switch. Software development is not a field where you can just go to work. It requires a great deal of effort and agility to keep up with it.
We are in a profession where we are dead if we don't keep learning. To me being a software programmer is like being on a treadmill. You cannot afford to stand on a treadmill when it's on; you get thrown away. And that's exactly what happens the minute we quit learning in software development. Learning is something extremely important. And learning by taking a course, it's just one way of doing it. You could attend good conferences and symposiums definitely, but again all of those require budget, no doubt about it and we certainly must do that, but what's important is: that is something we're going to do a couple of times a year. That doesn't mean that we learn only a couple of times a year. So what do we do about learning? I want to talk about this as iterative and incremental learning. In other words we can not afford to learn something huge and large in just one day. We did this as students, cramming before the exam; we certainly shouldn't be doing that as professionals. - Venkat Subramaniam
One way to force ourselves to keep reading, learning is to do this within an organization. An example is to organize "brown bag sessions" where different people volunteer to be the lead in different discussions. You should be able to find at least one or two people that are interested in this kind of setup. Get them going, get management involved, arrange a few sessions and see what happens.
Just as we are interested in iterative software development we should be equally (or even more) interested in iterative learning. What did you learn today? Are you learning anything it at all? This should be a sign that tells all of us that it's time to get a new job
It's not easy but my personal goal is to become one of the mythical 5%
In my experience those in the 5% must struggle to get there, and struggle to stay there, and it's the process of continuous learning that makes the difference. - Bruce Eckel
We could compare software development with writing poetry. Mark Strand said that how good you are depends on how many poems you've written in your life. How do you get good at it? By writing poetry all the time. By reading relevant literature. By studying great poetry works.
I attended a presentation (again arranged by Valtech, thanks guys) by Mary and Tom Poppendieck. They wrote the award-winning book "Lean Software Development: An Agile Toolkit" in 2003 to explain how the lean principles from manufacturing offer a better approach to software development. Overall it was a good talk about how to avoid waste by "stopping the line": fix the defects write away, otherwise they will never get fixed or it will happen too thus increasing the cost of the system.
In the last part of the talk they commented that they had interviewed hundreds of projects that that they had seen that 60% of the code/features in a push-scheduled system are never used. This is one of the roots of the suffering in software development, according to Tom.
Why are most projects (apparently) using push systems? At least to me it seems that a pull system like kanban style (which responds to real-world demand or orders and forces the upstream process to respond) is much more logical. What about "push" project managers with no technical expertise whose only task is to track progress for different tasks? IMO that role seems pretty illogical as well. That's also waste.
A fairly common JPA anti-pattern is retrieving an object from the database before deleting it. For example, as documented here.
This is not so efficient as the implementation is actually issuing two statements (select and then delete) which is wasteful. The right way to do it is to use
This just issues the delete statement.
I just received an email letting me know that I've been recommended for reviewing Dan Allen's upcoming book "Seam in Action". Cool!
I'm looking forward to reading the first chapters of the book
![]()
JFokus is over. For 2 days Stockholm was the center of the Java universe. I missed the tutorial day but from what I heard it was great. The conference day was definitely worth it with a whole bunch of interesting talks. Some highlights:
Web 2.0 development with Java
Stephan Janssen talked about the hard life of an Ajax developer and showed how Flex can make RIA development easier but above all much cooler. Very nice demos (next gen Parleys) and to top it all off a glimpse of what you can do with Java FX. According to Stephan in a year or so JavaFX will be as groovy as Flex. If you haven't looked at Parleys I think it's time you do so.
Qi4J
Java framework pioneer Rickard Öberg showed a brand new programming model based on the concepts of DDD and AOP. Always a pleasure to listen to Rickard, definitely one of the smartest guys on the Java planet. I was kind of surprised to hear that he "only knows Java". More people should read Evan's book and understand the concepts.
Evolution with Grails
Good introduction to Groovy on Rails. If you are using Spring MVC or Struts 2. Why not use Grails? It's a bit slower (for now) but it's definitely much more fun and it takes much less code to develop apps using Grails. At least it can be a great idea to start using Grails for prototyping or when you need to do something fast (always?). Strong typing combined with scripting, productivity-boosting features like closures and without all the boiler plate. And above all Groovy is fun.


Recent Comments