Solved

Suggestions needed for communication between Java swing based rich clients and Spring-based application server

Posted on 2011-03-16
7
893 Views
Last Modified: 2012-05-11
Hello experts,

I am planing a redesign of a (Delphi) client-server application to java ee 6. I would like to use Spring 3 / Hibernate as a middle tier. The middle tier should serve several types of clients, mainly rich desktop clients, but also mobile devices and keeping the possibility to add browser-clients later based on a single middle tier code base.
I am planning to use Swing-based Desktop clients.

My question:

What communication type would you suggest for rich desktop clients? RMI?
Is it wise to consider the desktop client as "just another type of client" that communicates with the middle tier like any other client.

This looks clean and nice on an architecture blueprint, but is it practical? Or should I use some more sophisticated construction especially for rich desktop applications? For example to keep up a nice performance?

I read that the best remoting strategy is "not to use distributed objects at all" (Martin Fowler)...

What are your experiences? Suggestions?

Many questions, hope my problem is clear for you.
Thanks a lot, Daniel
0
Comment
Question by:waeberd
  • 3
  • 3
7 Comments
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 450 total points
ID: 35146058

>> What communication type would you suggest for rich desktop clients? RMI?

We use EJBs - mainly stateless session beans. It works great with remote Swing application and Hibernate as persistence. Of course, you have to watch out for performance bottlenecks (lazy loading with Hibernate, caching objects on client side), but once you get that done, the structure works well.

>> Is it wise to consider the desktop client as "just another type of client" that communicates with the middle tier like any other client.

In a sence of remote client, yes. The web client tends to use much of the Hibernate session and lazy loading stuff.


>> This looks clean and nice on an architecture blueprint, but is it practical? Or should I use some more sophisticated construction especially for rich desktop applications? For example to keep up a nice performance?

That is a good approach. The performance bottlenecks are on the lower level, where you have to have correct solutions for them. Like I said: lazy loading on Hibernate and caching objects on the client side.
0
 

Author Comment

by:waeberd
ID: 35146165
Thanks Dejan (again :-) ).

How do you manage the "caching objects on the client side"?

By relying on EJB-mechanisms?

Regards, Daniel
0
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 35146230

In the end it turned out that the most simple caching works best in my case. I never found a real library for caching Hibernate objects on the client side, so I designed the simplest possible caching - whenever I need an object of some class with a given id, I check if I already have it in the client side map.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 3

Assisted Solution

by:grouper15
grouper15 earned 50 total points
ID: 35146337
Hi waeberd

I suggest you go for web and mobile clients and also use web clients where you needed desktop clients. Desktop clients are only preferable if you need to communicate with peripherals or do I/O on the client side OR if you want to have substantial caching on client side or thick clients.

If your client is thin i suggest you go for presentation tier implementation in web and later on for mobile. it saves you a lot of time and cost.
0
 

Author Comment

by:waeberd
ID: 35146427
Hi grouper15,

Thank you for your suggestions.
Our clients are rather "thick":
It's a GUI-heavy planing and scheduling application that doesn't really fit well in a browser.

Now it's perfectly possible that this is my biased opinion, as I am working on this client-server application for years now.

But our strategy is to deliver "GUI-heavy rich clients" for the planning users while keeping the potential to add mobile / web clients later on a common middle tier.

So I would go for a swing-based rich client for desktop (using for example JIDE component packs etc) communicating to a middle tier based on Spring / Hibernate.

Would you still use a web client?

Thanks again,

Daniel
0
 
LVL 17

Assisted Solution

by:Dejan Pažin
Dejan Pažin earned 450 total points
ID: 35146521

>> Would you still use a web client?

I would just like to add from my experience, that this is a crucial and very common question. We decided for the web client in one case and the cost of the decision was very high - a simple functionalities which are part of Swing for 10 years, are only emerging now on the web. That means they are difficult to implement, work slow, have bugs...

You should decide based on what you really need. If you need web, then go for it, if you need very intensive gui, then Swing wins hands down.
0
 

Author Closing Comment

by:waeberd
ID: 35152401
Thank you folks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now