- Java Enterprise Tutorial (https://docs.oracle.com/javaee/7/tutorial/doc/javaeetutorial7.pdf)
This week I was certified sick and wasn’t able to visit the lecture on Thursday. So let me combine the daily tasks and weekly analysis due the reduced learning activity this week.
This week, I was sick until Friday. Fortunately, I could read a lot of literature and I used the time to get a deep introduction into Java Enterprise application development.
Therefore, I read through the Java EE 7 Tutorial. The term “tutorial” is too less for the detailed documentation that Oracle provided. When I read through the PDF-documentation with 900+ pages, I noticed that it was more a documentation on the different components within Java Enterprise applications. So let me state the learning goals of the tutorial:
- The learner is able to draw the different layers within a typical Java Enterprise (JEE) application.
- The learner recieves a basic understanding of the interaction between JEE layers and the exercises of each.
- The learner is able to name the software design patterns and models that are implicitly used within JEE applications, e.g. “Separation of Concerns”, “Aspect-oriented programming”.
- The learner is able to create an own JEE web application, including the required configuration and deployment on an JEE enterprise server.
- The student is able to name the most important services following the JEE standard that JEE application servers offer, such as: “Contexts and Dependency Injection (CDI)”, “Java Persistence API (JPA)”, “Java Standard Tag Library (JSTL)”, “Expression Language (EL” and so on.
- The student is able to write “facelet views” by using Java Server Faces (JSF) in order to achieve a better separation of logic and presentation and to have mighty capabilities to build browser-based JEE – web applications.
The documentation allowed me to replace my understanding of JEE to be a black-box doing a lot of complicated things by a good perspective on the main achievements of the big JEE platform. I understood why enterprises like JEE: because it allows them to develop their business logic independent of functional logic. There’s a whole layer called “Enterprise Java Beans (EJB)” layer which allows to implement the logic by focusing on use-cases. The EJB container as a part of the application server handles the instanciation of those EJBs and allows to have pools of stateless EJBs which allow dependency injection by annotations and increase the performance because the instances are kept in the server’s RAM. The dependency injection allows loose-coupling because you define business interfaces for each EJB in general and you don’t have to care about the instanciation of the EJB that you need to address in some other EJB.
A really nice aim behind JEE is: the EJB layer contains the business logic which can be used regardless to the context of the application using the business logic. For example: you could develop a desktop application which accesses the EJBs directly on some remote server or you could develop a big browser-based web application. Therefore, JEE also offers a Web Container layer (see the figure above). There you can define HTML views by using simple Java servlets or – if you aim to be more professional – Java Server Pages (JSP) to achieve a better separation of presentation and the web application logic (such as handling the request-response model of HTTP). Or you can use the rendering framework Java Server Faces (JSF) which allows to create views using special XML-Tags. Those views make it easy to access backend logic (Java Beans in the Web Container) and reduce the gap between client and server. For example, JSF also offers support for AJAX-actions. When developing using JSF, you don’t really notice that your actually developing client code in the JSF view, because it will be rendered on the server side and delivered to the client as pure HTML.
So the good understanding of the architecture helped me to loose my fear of JEE. We are currently developing an application for car-pooling which uses JSF and JPA. After I read through the documents we started to make good progress because I suddenly knew what I was doing. Before, we mostly used quick tutorials to achieve certain goals such as “how to develop registration using JSF?”. Those tutorials didn’t really help to understand the connection between all the JEE components and how they interact together.
I learned that it’s better to read official docs and to be not afraid of the length of those docs. It’s even better than following simple tutorials which leave you uncertain about what you are currently doing.
Goals for next week
I started to state the learning goals again. Next week, I want to find a way to organize better – because I have a lot of work to do right now. Important goals are: how can I find time for each module once a week?