users@glassfish.java.net

Architecture-related question (Multi-Layer App)

From: <glassfish_at_javadesktop.org>
Date: Wed, 10 Jun 2009 06:40:23 PDT

Hi All,

I have a question regarding architectural related issues.

I am planning an application that will have a considerable amount of business logic. There will also be different ways for different target groups to access this logic, e.g. web application1 and mobile application1 for target group1 and web application2 and mobile application2 for target group2. I think its reasonable to split the overall functionality into diffferent lighter-weighted apps rather than implementing one heavy-weighted app because the functionality to be implemented in each app is quite different. To sum up, there are several smaller applications in the presentation layer and a big application in the backend layer. Of course, apps will be added from time to time. At the beginning, there will be only the app in the backend and web application1 for target group1.

I was thinking about what technologies to be used. There is a strong experience in Java. However, basic knowledge in Groovy, Ruby, PHP has been gained in smaller projects.

Thus, I was thinking about the following design alternatives:

1.) Using Spring-based app in the backend app and Grails/Rails for the web app. Grails/Rails will interact with the backend based on RESTful Webservices - a service-oriented architecture so to say. In this case, there will be now dedicated database for the web-app. All data would be requested from the backend using services. Choosing such an architecture allows for independent scalability which is quite important because the app in the backend will get more demanding the more apps in presentation layer will be added or the more user will consume the application.

2.) Using Grails app and putting the backend functionality (as spring beans) into the grails framework. I personally think this is the worst alternative because the business logic supposed to be used by different apps could not be deployed independently from the grails app. Furthermore, all the other web apps would have to access the grails app.

3.) I have heard about OSGI but I am quite unsure whether and how it might be applied to the scenario mentioned above.

I actually prefer alternative 1 because it fosters loose coupling between the different apps (that will be added from time to time), allows for scalability and re-use of the functionality of the backend provided as services. I prefer an architecture using Spring for the backend and Grails for web apps. Using RESTful services for communicating between bot backend and presentation is only one solution. I am not quite sure about performance related issues because there will be quite a lot communication between the web-apps and the backend.

Give anyone give some feedback regarding the alternatives proposed? Does anyone see an alternative regarding how to realize communication between independent grails and spring apps?

Thanks,
Scholle
[Message sent by forum member 'scholle' (scholle)]

http://forums.java.net/jive/thread.jspa?messageID=350474