Bypassing J2EE or reviewing Tapestry 5 framework on the example of a blog

    Here I publish only the introduction to the article (rather mini-books). The rest is available here .

    Two years ago (2006) I was looking for an alternative to PHP and my MVC bikes. At that time, professional frameworks were just beginning to appear in PHP (for example, the Zend Framework did not wait for the release), the RubyOnRails mod came in, heard something about Django. Going into fashion, I studied a couple of books on RoR, but in the end I did not get involved with Ruby, apparently stopped the difference between the syntax from C similar languages. As an option, I considered creating the web in C ++, but after looking at the existing frameworks, I changed my mind. There was nothing to choose, so the choice fell on Java - a technology somewhere between PHP and C ++.

    J2EE was too confusing for a beginner. PHP programmer new was faced with a dozen frameworks that are imposed to create the web on J2EE. Servlets, portlets, JMS, RMI, EJB, JSP, JSF - which was not there! But then I found out about J2EE alternatives like Spring.

    Spring did not reach, for some reason it seemed that in complexity it was at the J2EE level. Stopped at Tapestry4 . This framework has been compared to JSF, one of the J2EE web presentation technologies. Through Tapestry4 I first learned about IoC engines (in my case it was HiveMind ). Later I learned about Wicket, which allows you to make the presentation of the web no worse than in Tapestry4. But then the alpha version of Tapestry5 came out, which finally stopped.

    Tapestry5 liked a lot of things. Firstly, the configuration of the framework is done through annotations - XML ​​configuration is minimized. Secondly, changes in templates and code are dynamically picked up, without reloading the servlet container - the main problem of J2EE and other Java frameworks. True, this only works for the code that Tapestry5 knows about (components, pages, and something else), but it's not bad either. And thirdly, a competent OOP approach, simplicity and the presence of its own IoC engine.

    To work with the database, I decided to use ORM Hibernate. I think this is the most powerful opensource ORM currently available, so the choice was obvious. And the advent of HibernateSearch, HibernateValidator, HibernateAnnotations - finally strengthened the decision to continue working with Java without looking back to Python with Django.

    For 2007-2008, Tapestry5 was in alpha and the developer API was constantly changing, so I had to study the code. On the one hand, I lost time, but on the other, I studied the framework better. I have accumulated experience that I want to share on the example of developing a small blog.

    Project sources are available here . The work can be seen here . To enter the control panel, login admin and password admin .

    Also popular now: