Question

I'm an amateur java developer and I have been working on this web application in my current company. The application is made in the Spring MVC framework. Hibernate is used as the ORM tool while the database is the DB2. Maven is used as the build and deployment tool for this application. The presentation layer and the service layer are totally seperated from each other, I mean both the layers are in seperate web application containers. We use two different servers for this, an Apache Tomcat and a JBoss Application server. Apache Tomcat is used as the server that contains presentation layer and JSPs with all the CSS and javascript stuff. While the business logic and service classes are present in the JBoss Application server. Below is the diagram representing the architecture of the appplication.

Web Application Architecture

So the Idea here is that all the presentation logic of my application is present in the apache tomcat server while all the business logic is present in the JBoss server. In order to connect the presentation layer with the business logic we use the Spring HTTPInvoker. Spring HTTPInvoker is similar to Remote method Invocation but through HTTP Protocol. Data is passed between the two layers through form objects. The form classes are present in both the servers. Hibernate takes care of all the connections with the database.I asked my supervisor about the benefits of such architecture he said that the presentation logic is completely decoupled and even if the JBoss stack is down we can add another stack resume the oprations as soon as possible. I argued with him that the MVC Pattern already gives that amount of abstraction and decoupling. Just for the sake of scalability they are seperated the two layers in two different servers.

I wanted to know the advantages and disadvantages of the architecture in terms of performance,scalability and flexibility. I'm currently studying the enterprise application design patterns. Please tell me your opinions on the architecture and what needs to be fixed or improved.

Was it helpful?

Solution

I've never seen such an architecture and frankly speaking I can't see any substantial advantage.

1) If JBoss server is down - does this mean that you need to set up another instance. But if your application is entirely on one server - you need to set up another instance as well. No difference.

2) HTTP channel between servers - here we get an performance overhead and gain nothing except for problems related to developming and maintaining this stuff.

3) Separation of presentation and business logic - this kind of stuff sounds good in theory, but there may be exceptions in practice. The thing itself is good, it makes the code way more clean, but one doesn't have to go to extremities.

Thus, I see no benefit in this configuration at all. Maybe I miss something important, everything above is just my point of view.

OTHER TIPS

If you have multiple applications (or plan to have in near future), this architecture makes sense. You can reuse the business/service layer. I am assuming the service layer is coarse grained and not tied to UI layers so that every UI change does not require a change in the service. Often the problem is not with the architecture/design pattern. It's a poor implementation/abstraction/contract.

Licensed under: CC-BY-SA with attribution
scroll top