Solved

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

Posted on 2011-03-16
7
910 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.
Suggested Courses

738 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