This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes General Computing and the fly likes MVC Web - Architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "MVC Web - Architecture" Watch "MVC Web - Architecture" New topic
Author

MVC Web - Architecture

Andr� Salvati
Greenhorn

Joined: Mar 21, 2005
Posts: 24
Hi,

I'd like to develop a system for an industrial plant using MVC pattern and Web resources, but I noticed that it's difficult (maybe impossible!!!) to make notifications from Model tier to View tier because i can't just send responses, without requests. The goal is to provide dumb terminals with the state of the plant. There are about 100 terminals and I think it's almost impossible to provide a good response-time by putting this clients on a loop to get modifications in Model tier. It could overload the server.

1 - Is it possible, to send Responses without requests?

2 - Would Swing be a more appropriate resource in this case? Or Applets?

3 - I'm looking for articles, examples or books with tips about this kind of solution. Where i can find?

Thanks.
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

We'll move this topic to General Computing for now.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Tom Billings
Greenhorn

Joined: Sep 12, 2005
Posts: 16
Hi Andr�!

It won't solve your problem since I doubt it will scale well to 100 clients, but check this out:

http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html

This might give you a few hints for a more scalable web-solution:

http://java.sun.com/developer/technicalArticles/J2EE/AJAX/

Finally, applets and, of course, swing-clients are much better suited for server-side notifications by using the good old MVC-pattern. You can find info about this on virtually any page describing MVC-implementations.

Good luck!
Andr� Salvati
Greenhorn

Joined: Mar 21, 2005
Posts: 24
Hi Tom...

Thanks a lot for your tips.

I'm also looking for literature about Domain Modelling for this kind of solution: industrial automation. For example: I want to know what kind of Entities, layers and patterns are the best approach to this solution. Any tips?

Thanks again.
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 307
Originally posted by Andr� Salvati:
I'd like to develop a system for ... Web resources, ... The goal is to provide dumb terminals

Dumb terminals are not Web resources.


Originally posted by Andr� Salvati:
I think it's almost impossible to provide a good response-time by putting this clients on a loop to get modifications in Model tier.

The server needs not loop for that. Each time "the server" changes the model data this (hopefully centralized) method must notify all [registered] clients. But that would assume the server could send reports without requests.

On the other hand if you assume each client can periodically poll ("loop") the server for plant-state-changes than for the logical part you are done.
Laying out the plant-state-report let's say once each second and on each poll sending back the prepared/cached plant-state-report to the polling terminal can not be too costly.


Originally posted by Andr� Salvati:
I'd like to develop a system for an industrial plant using MVC pattern and Web resources, but I noticed that it's difficult (maybe impossible!!!) to make notifications from Model tier to View tier because i can't just send responses, without requests. The goal is to provide dumb terminals with the state of the plant. There are about 100 terminals...-

There is a technical impossibility to notify dumb clients, but this is the goal of the intended technical [and budget driven?] infrastructure.

Somehow adding an implicite plant-state-polling to any "send block" command received in the server could be a chance of solution _if_ it is sufficient to notify _actively online_ working people only, not people just being in the room where the dumb terminal resides.
The plant-state-response would have to be appended to the original reply or even be sent back alone.

If it is necessary to notify people just being in the room: Is there a chance to add a timer in all or some critical terminals (or even a parallely connected pseudo-terminal) that causes the [pseudo-]terminal to poll plant-state-warnings each 10 seconds ...

That sounds technical but screen-scratching is on the same level.


Originally posted by Andr� Salvati:

1 - Is it possible, to send Responses without requests?

No, not with pure dumb terminals.


Originally posted by Andr� Salvati:

2 - Would Swing be a more appropriate resource in this case? Or Applets?

Surely, but not with pure dumb terminals.


Originally posted by Andr� Salvati:

2 - Would Swing ... Or Applets?

Again: not with pure dumb terminals.
With workstations / PCs:
Applets may use Swing. The contradiction is "Java client application" versus "Applet".
Since there is the Java Web Start technology (see java.sun.com) you probabely will use apps. Today you need to use Applets only if they must be startet by and within a browser. Within a plant a Java client application via Java Web Start might be your choice.

Thomas.


www.classic-and-class.com - www.evalulearn.com
Interfaces are the glue of OO.
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 307
Originally posted by Andr� Salvati:
I'm also looking for literature about Domain Modelling for this kind of solution: industrial automation.

That is quite another topic. You will need at least data modelling!, and maybe some businss process modelling and optimization.

Originally posted by Andr� Salvati:
I want to know what kind of Entities, layers and patterns are the best approach to this solution. Any tips?

Entities are the ones you added in the data model.

Layers are technical like for transportation, ... not my topic.

Patterns are best discussed in the forum "OO, Patterns, UML and Refactoring". Just some hints for your start: Concentrate on SessionFacade, BusinessDelegate with ServiceLocator and ValueObject first.
Additionally you will need some persistence mechanism like EJB.

But please discuss that in the appropriate forum.

Thomas.
Andr� Salvati
Greenhorn

Joined: Mar 21, 2005
Posts: 24
Thomas,

With "dumb terminals" I meant terminals that just receive data, but surely I'd have compelled to address some actions in clients.

I'm gonna ask the other questions in more appropriate foruns.

Thanks for your answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MVC Web - Architecture
 
Similar Threads
Model View Controller Question...
MVC
BD,SL and TO Patterns
Automatically refresh datatable when Session Bean changes
Servlets interview questions . . .