Note: This tutorial is gonna show you how to code Java without any of the traditional B.S., like XML and app server restarts. It’s split into 3 parts so that your brain doesn’t freak out at a 50 meter long webpage. Enjoy!
Did you realize that Hibernate has been around for more than 10 years? And Spring will begin its second decade next year? There was a time when Spring+Hibernate was widely considered an unofficial industry standard, but today is portrayed as an ancient beast whose XML appetite kills little rainbow scroll wheels. That assessment is not true, however. Both technologies have seen continuous development and are still competitive today.
Doesn’t it make more sense to compare apples to apples? For example, don’t put JEE6 with CDI up against Spring 1.0. Spring and Hibernate don’t require three miles of XML anymore. In fact, it’s possible to set them both up with zero lines of XML.
With servlet 3.0, even web.xml can go the way of the dodo. When all you’re trying to accomplish is a simple helloWorld guestbook, then Java, Spring and Hibernate will require more effort to get there, but can you name any app which is that trivial in real life? Proper applications are expected to satisfy far greater needs, both functional and non-functional, which is the area where Java, supported by wisely-chosen tools & frameworks, really shines.
Note: This tutorial continues from Part 1 and is gonna show you how to code Java without any of the traditional B.S., like XML and app server restarts. It’s split into 3 parts so that your brain doesn’t freak out at a 50 meter long webpage. Enjoy!
Adding Hibernate to the mix is rather easy. All I need to do is add a few beans to the
WebappConfig class. Which beans to add depends whether you wish to stick to the classic Hibernate API that uses SessionFactory or switch to a modern JPA, which uses
EntityManager instead. Note that JPA is a specification and we’re still using Hibernate as an implementation. The basic concepts and programming model are the same for classic Hibernate and JPA, but in my opinion JPA is easier to set up and more beautiful, not to mention it being an official JEE specification. By the way, even when using plain old Hibernate, the class annotations such as
@Entity still belong to JPA.
Note: This tutorial continues from Part 2 and is gonna show you how to code Java without any of the traditional B.S., like tons of XML and app server restarts. It’s split into 3 parts so that your brain doesn’t freak out at a 50 meter long webpage. Enjoy!
Part 1 | Part 2 | Part 3
Enough with the setup, let’s write some code!
Once upon a time, Sun started with the PetStore sample application and Spring continued it with the PetClinic. Now that the cute little goblins have been bought and cared for, let’s publish their pictures for the whole world to see – introducing Snoutbook!
Some time ago we ran a survey asking a few questions about the build process, specifically the tools that are used to do incremental builds and how much time those builds take. We had over 600 responses, so now it’s time to count the results.
This is the first time that we’ve published results on the incremental build process, so the information is more likely to serve as a guide than an authoritative information source. That being said, the information is still quite interesting, and if it serves to start a conversation that improves the process of even one team, then we’re proud to have helped out. If you haven’t answered the 3-question survey yet, take two minutes and go for it – and do let your community know about it – as more answers trickle in we’ll update this post with the new data. If you’d like to play with the results on your own we‘ve provided all the data and our calculations in a handy Excel sheet that you can download here.
We’re looking into incremental builds — trying to document the differences in popularity & productivity between using tools like Ant and Maven versus IDEs. We haven’t seen a study like this before, so thanks for taking a minute to fill this out. If you’re interested in winning a free license of JRebel (formerly JavaRebel), include your email address in the optional email section.Read more