• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Designing a large web application.

 
Bartender
Posts: 1150
38
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I need your advice about designing / organizing a quite large web application. This application will be functionally divided in several areas, and , because I would like to avoid classical monolithic approach,I'm thinking about implementing each module (order entry, customer registry, products and so on) in a separated WAR module. Each module will be deployed in a single EAR and each WAR will use for its business logic services exposed by a centralized EJB project, which in turn will be part of the EAR.
What do you think about this design idea? What are major flaws in a similar approach? Thanks for your help.
 
Saloon Keeper
Posts: 10308
217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds too fine grained. Read this article: http://martinfowler.com/bliki/MonolithFirst.html
 
Claude Moore
Bartender
Posts: 1150
38
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stephan for your reply. To be honest, I've read some time ago Martin Flower's article you linked, and it seems a good answer to all the buzz around microservices based architectures.... an architectural style that i'd like to adopt without falling into a too much fine grained approach. Using different WARS under the same technologic umbrella (Java EE) seemed a good idea, but it may actually turn out to be too much fragmented. I love the idea to be able to build an application focused only on a main task (orderentry for example) without coping too much with other modules,and - why not ? - potentially to be able to play with different frameworks for each module, if needed. Another advantage I see is that one may update a single war (i.e a module), or choose a subset of modules to compose a custom application installation. Of course, the main concern is coordinating the whole thing.. and make it work !
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to look at the Play framework for Java/Scala:

https://www.playframework.com

Play is a MVC web app framework built in Scala (with a Java API as well) and designed for scalability. It's not tied to the Java EE stack but still runs on the JVM, and has good support for building web services.

There's an introductory course for Play in Java on Udemy which is available for £9 until 11th January:

https://www.udemy.com/play-framework-development-with-java-program-java-web-apps/

No idea if the course is any good but at that price it hardly matters!
 
chris webster
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

chris webster wrote:There's an introductory course for Play in Java on Udemy which is available for £9 until 11th January:

https://www.udemy.com/play-framework-development-with-java-program-java-web-apps/

No idea if the course is any good but at that price it hardly matters!


Just signed up for the course and went through the first few videos to see what it was like. Looks like a decent introduction to Play in Java covering the basics of setting it up and building a simple MVC application from scratch, and it's been updated for the current version 2.4. So if you're interested in trying Play for Java, and you have £9 to spare (before 11th January), this looks like a good place to start. There's also an offer for a 90-day extended free trial of IntelliJ IDEA Ultimate for course participants, although I only just signed up for this today and it may take a few days to process, so I don't know if this offer is still valid.
 
Claude Moore
Bartender
Posts: 1150
38
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chris for the suggestion. I think I'll have a look at Play! framework as soon as possible (and the course you suggested looks great). Anyway after thinking a while more on my problem, I believe that the real question is how to effectively design a complex web application, whose modules may interact each other. It's not only an architectural design. It's firstly a web UI design problem. I don't know if Play! may be helpful to address this problem (even if it seems to me another way to MVC pattern, more or less). What I really need to know, is how to approach scenarios where end user wants to work with Order Entry while interacting with Store module to search for available products ready to be sold and, at the same time, while consulting Customer data sheet.
Is there a good starting point to learn from ? Most books about web design date back to 2008 / 2009 years, and a lot has happened since then, so I presume that they aren't updated to recent approaches...

Thanks for your help, I really appreciate it.
 
Stephan van Hulst
Saloon Keeper
Posts: 10308
217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Claude Moore wrote:Thanks Stephan for your reply. To be honest, I've read some time ago Martin Flower's article you linked, and it seems a good answer to all the buzz around microservices based architectures.... an architectural style that i'd like to adopt without falling into a too much fine grained approach. Using different WARS under the same technologic umbrella (Java EE) seemed a good idea, but it may actually turn out to be too much fragmented. I love the idea to be able to build an application focused only on a main task (orderentry for example) without coping too much with other modules,and - why not ? - potentially to be able to play with different frameworks for each module, if needed. Another advantage I see is that one may update a single war (i.e a module), or choose a subset of modules to compose a custom application installation. Of course, the main concern is coordinating the whole thing.. and make it work !



It's very hard to identify ahead of time what parts of your application naturally lend themselves to modularization. Just start working on the problem, and when you start becoming unhappy with how interwoven and bulky it becomes, that's when you have enough information to make a more modular design.
 
chris webster
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you might want to look at Microservices here. I don't know much about it, but this seems to be the way people are starting to build these complex interacting applications.

Each "microservice" provides a small clearly defined service e.g. "product catalogue", and is supposed to be self-contained. An application would have lots of these microservices interacting with each other. The article above suggests using lightweight messaging tools in between the microservices, and I think this is one place where people are using Apache Kafka.

The individual microservices are also meant to be relatively lightweight (not monolithic Java EE applications) e.g. so you can deploy them quickly and easily on different hardware/virtualised infrastructure via containers like Docker, but this stuff is definitely outside my comfort zone!

In terms of the application tools for implementing these microservices, Play has good support for scalable web-facing services i.e. it's not just a standard MVC server. Alternatively, Akka-Http is a lightweight HTTP server that integrates with the Akka framework for managing concurrency. Akka is written in Scala but supports Java as well, and is actually used inside Apache Kafka, for example.

Hope this helps.
 
Claude Moore
Bartender
Posts: 1150
38
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

chris webster wrote:It sounds like you might want to look at Microservices here. I don't know much about it, but this seems to be the way people are starting to build these complex interacting applications.


Exactly. Using Microservices indeed was my first thought... times ago here at the Ranch we had a book promo just about Microservices based architectures. I've been struck by the underlying idea - build apps as a system of self-contained services interacting via REST. In my humble opinion, anyway, Microservices is an architectural approach still "under construction", if we can say so.. It's a fast moving topic, an edge technology: you named for example Apache Kafka, Docker, I would add Kubernates to the list... quite a big bunch of things to study and experiment on, isn't it? I would exitate before adopting a pure Microservices-based approach in production, at least for an application that must be production ready.
In my opinion, Microservices approach has got a very important key feature: first, each service may be built using a different technology stack (and this is not generally true for a monolithic application), and, second, you are forced to adopt a real modularization in your application. Those are features I'd like to recover under a pure Java EE umbrella, but I'm not sure if it may pay off within Java EE.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably this is late. So how did you actually design the appication in the end?
 
Claude Moore
Bartender
Posts: 1150
38
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Believe it or not, the project is STILL stuck at design stage. It has been suspended and resumed I cannot count how many times. By the end of next month, I should present a 'definitive proposal' of the general architecture of the project. Meanwhile, I observed how microservices architectures evolved, but at the very end I don't think that we will adopt this architectural style, at least not immediately. Main goal is to keep modules loosely coupled as much as we can, but the effort needed to adopt a 'pure' microservices-based approach (which implies to deal with multiple, maybe containerized applications, single simple applications )  exceeds the benefits we'll be able to get, being a rather small team of developers. So, more likely, we will adopt Spring in a monolithic-old-styled application, taking care to avoid as much as possible strict coupling between software modules.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!