• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Architecture for a Java EE University Project

 
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone.

First let me apologize if the topic doesn't belong to this section.
I'm a student and I've got to make a university project. Generally speaking, what I want is a web app that would allow to deal with some data in a database with standard CRUD-like operations and provide a childish API to make this data available from some other clients. Essentially, nothing special, but not for me. I decided to make it Java EE-based since I've been learning Java for some time. Sure I know you should first take an overview of all the technologies to choose the most suitable one, but I'm obviously not in the position to show my expertise (or lack of it, which is definitely more plausible). The problem is I'm a little bit overwhelmed with a set of technologies constituting Java EE and related ones and I guess I may not need to study the whole thing now. So the main task is to finish my project and the secondary one is to gain skills needed to work as a Java EE developer with a help of this project.

I decided to utilize some sort of MVC pattern with my project. As far as I understand I need servlets as Controllers, some plain Java classes as Model (business logic). Maybe I should use Hibernate to get some experience with this framework. And I'm a little bit stuck about the View. JSP/JSF/Template Engines? Does GWT belong to this layer? As a possible hint for this part I would like to use Google Maps API in the web page to superimpose my data on the map.

I clearly don't want to be a typical student type asking someone to do all the work. I'm accustomed to self-education. I need a direction and a helping hand. I'd appreciate any advice. Thank you in advance.
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You already realize that the choice of frameworks and technologies is normally based on lots of factors, and that there is no "best" approach - that's good! I think wanting to sidestep that process is reasonable for a student project, so I'll make some recommendation that IMO you can't go wrong with, and comment with respect to later applicability.

For the web app, servlets and JSP are a good way to start. Other template engines (FreeMarker, Velocity) and other frameworks (GWT, JSF) are not used widely enough that you'll necessarily ever come in touch with them later- It's good to know different approaches, though, so if you have spare time learning a very different framework (GWT, Play, Wicket) would be a good educational experience. If you want to use a bit more than "naked" servlets and JSP, check out the FrontMan framework that implements MVC; it has the advantage of not doing a whole lot as far as web frameworks go, which means there isn't that much too learn (and it sounds like you have much to learn anyway). For learning servlets and JSP I recommend to get a book to more it a structured learning experience, maybe something like Head First Servlets and JSP.

For using Google Maps you need more JavaScript knowledge than Java knowledge, and it has no connection to, or dependency on, GWT.

For the API, read up on RESTful web services (https://coderanch.com/how-to/java/WebServicesFaq). The standard Java API for that is called JAX-RS, and the standard implementation library is Jersey.

If there's DB connectivity, you'll want to learn JDBC, the standard Java API for accessing DBs. It's very common to use an ORM API on top of that (maybe JPA or Hibernate). If you have mastered JDBC and have time for more, I'd probably go for JPA (the standard Java ORM API), but the Hibernate API is conceptually similar, so if you know one you should have few problems picking up the other.
 
Mike Petrov
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ulf!

First let me apologize for not giving an immediate reply: i've been on a foreign trip.

Your answer has definitely cleared a certain amount of vagueness! I'll stick to my initial plan of learning Servlets and JSP. I'll leave specialized frameworks for later since they should be chosen for the particular project.

I'll post more questions as I advance with my project. And again -- thank you for your answer.
 
Mike Petrov
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've stumbled over the Model-View relationship in MVC. There's a small diagram in HFSJ that shows Controller between Model and View with V and M not knowing anything about each other. That's how I wanted to design my app. But it turned out that it's more an MVA (M-V-Adapter) pattern than the MVC since View doesn't talk to Model. Is that right? I don't want to ask a vague question but I don't really get what are the advantages of mixing M and V allowing them to talk to each other if this could be done using intermediate controller.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the university project starting with plain JSP should be enough - the MVC concept works OK for whole pages. The next step depends on what your aims are - another university project, deeper understanding of MVC or future job security. For the latter you'd better choose the most complex and most widely used of technologies. For a deeper understanding you have to move towards component oriented frameworks - those that support MVC pattern not only at the page level but at the level of reused components - like Wicket, Tapestry, JSF or HybridJava.(As far as I know Spring MVC, Play, Velocity, Struts2 are not component oriented enough.) You have a chance to dive for years in studying technologies so for your being with the university choose the most simple thing - IMHO that is HybridJava.
 
Mike Petrov
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The next step


D'oh! I'm yet to finish this particular step ;)

One of the things I wanted to achieve was to use industry-popular set of technologies. Maybe the whole project structure would be awfully realised but I really want to scale a real-world set of technologies to my university project. This is my contribution to the aspect of job security. What about frameworks, in my area they mostly want to see Spring and/or Struts in your CV.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Start with plain old servlets and JSP. Until you have a really good handle on them, the frameworks will be mystifying.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic