Jose Leon
Jose Leon

Reputation: 1651

Java design question on which framework to use? JBoss, Rest, etc

I'm interested in creating a client/server app in java, but not certain which framework to use. Here are simple scenarios to check disk space:

Scenario 1 1. A user would click on a button on a web page console "Get current disk space usage". 2. The servlet would get all machines from a db and ask each one to return their used disk space. 3. Each machine would reply with the used disk space.

Scenario 2 4. Each machine would update a service every 24 hours with its used disk space.

From what I can tell, I need to have a tomcat instance to host a servlet as the console. From here is where it gets murky for me - and hence this question. Would I also need a) a SOAP service for #4? b) a SOAP "client" running on each machine for #2?

I'm just not sure when to use SOAP services vs. RESTful services, etc. Any opinions would be appreciated. Fairly new to java, so apologies for any mis-spoken jargon.

Upvotes: 0

Views: 125

Answers (3)

Jarek Rozanski
Jarek Rozanski

Reputation: 800

I would suggest lightweight approach, as your use case is fairly limited, I would suggest going with embedded Jetty, Spring MVC and possibly JSON or XML response.

This will simplify deployment as you can wrap Jetty in wrapper application and make it runnable as process or service in either Windows or Linux, plus the footprint on the whole system will be fairly small.

This could change if you plan to extend this application with more feature and more integration point with other services/applications/protocols.

Upvotes: 0

alphazero
alphazero

Reputation: 27224

SOAP is only relevant in context of an open ended system where service discovery, etc. would be useful. Otherwise, it is a PITA and entirely overkill.

RESTful services -- recommendation: use json -- would more than suffice for your purpose. Tomcat is not your only option. Jetty is quite excellent as well.

Upvotes: 0

Vicente Plata
Vicente Plata

Reputation: 3380

You don't need a SOAP service nor a client. It would be nice, of course, but (if in a hurry) you can use your own format. CSV's, pipes, whatever fits you.

I've found SOAP services are easier to read but they are not the best choice when you expect a lot of data, mostly 'cos of the tags that you have to open and close. JSON is my choice in these situations.

Now, what you're talking about are not frameworks. They are protocols or convention. A framework is more language-dependent, like Struts, Spring, Tapestry, iBatis, etc.

Hope this helps.

Upvotes: 2

Related Questions