I currently have a full java web application stack (J2EE web app using Spring and Hibernate with a RIA client using dojo).
I have to move technology stacks for the UI to be asp.net but am allowed to keep the server components in java.
Any ideas on best practice here - and yes, I have to adopt this hybrid tech stack.
Initial thoughts are:
asp.net ajax (possibly using asp.net MVC) to provide the UI and a thin control layer in IIS.
expose current java web app (residing on a remote machine) as RESTful web services (the web app would remain in a J2EE serlet container such as Tomcat or Jetty). The new control layer would provide security (authentication and authorisation), comet server push abilities and then basic request passthrough to the web app.
Basically, I am unsure 'how much' C# I should write in the control layer and how best to expose and communicate with the existing java web app. Also, currently, I use JSON as the data interchange format.
I would suggest you start moving to asp.net feature by feature, don't try to implement everything at once.
Related
I have to develop enterprise level application using Java technologies. I decided to develop client side environment with swing and server side related things using Java EE components. My planned way could be described as following
First swing client makes request to application server. And application server has business logic and it has ability to decide which way should transfer my requests. Database server has my DBs.
these technologies I willing to use.
swing for client side
servlet for HTTP request handling in application server
EJB for handling business logic in application server
Hibernate to access my DBs form EJB.
Could you tell me above architecture is compatible with JEE enterprise level system architecture?
Swing <==>Socket<==>JEE (Application) REST based <==>Hiberate (DAO)
Yes its good but.
But if your application is going to be used by different end user devices then you need to think different way of client side.
Using JNLP you can deliver your SWING client items to your end users that will give you better upgradation and later customization also possible without any intimation to your clients.
This is my points only.
After several months of searching & reading, now i need your help, taking in consideration the following:
- My Application Developed using Java Swing.
- MySQL has been used as database.
- JDBC has been used to make the communication between the application & database.
- The application will run on network environment with multiple client will connect to database.
- The application use Financial transactions, Posting, Billing ... etc.
** now i want to develop a server side that will work as middle-ware, this server side will do the following:
- Connecting to the database to retrieve data as client request.
- Business logic will be on the server side.
- Client will not know about the database.
- Queries Syntax will be on the server side.
- The Client will View,Save,Edit, Cancel ... etc, sending these actions to the server side & server will response.
--- I have read about JFC, J2EE, EJB ... etc, but i don't want to run my application from browser, it will be kept as desktop application only due to the complexity of the application.
--- So i will do it using Sockets.
Any ideas, or tutorials that i can follow?
I suggest using a web-based approach to writing the back-end (e.g. a web service, either SOAP or Rest), and then communicating between the swing app and the back-end app via HTTP / HTTPS.
This is how mobile apps are typically written, and your swing desktop app is no different from a mobile app in this respect.
As far as frameworks for the back end, both Spring MVC and Grails make this pretty easy. Do yourself a huge favor and stay away from EJB unless you really need.it and understand why.
When you have 1-2 hours left, it might be worth to look at the Scout framework.
Scout seems to be a pretty good fit to your application context. Scout applications consist of a Scout server that handles access to web services (currently including support for JAX-WS) and database access over JDBC. The Scout client communicates via HTTP(S) with the Scout server and is available in the form of desktop clients (either supporting Swing or SWT) and as web application (currently based on Eclipse RAP). The web client also supports different renderings to optimize the application to desktop browser or mobile devices with touch support.
Here is the background of my situation:
I want to create an iPad application that interacts with a oracle SQL database. I have existing Java code from my Flex application that handles all the database requests, and modifications using the Spring Framework. The Flex Application ran as a web service through TomCat. Now I want to make that flex application into a mobile iPad version. I am having trouble figuring out what is the easiest way to use existing Java code and use it for the iPad because the iPad interacts using URL requests instead of direct with the Java.
My question is, can I use the existing Java code with the Spring framework to save time from coding all the back-end handling? Basically I want to access all the classes from my Java code by doing Requests from the iPad. Is this possible and will I need JSON or XML to interact between the iPad and the Java code?
Summary:
Can I use
iPad Objective-C <-----> Java (with spring framework) on TomCat Web Service to handle oracle SQL data handeling? If so, how and what technologies do I need? Will I need JSON or XML and how does that factor between the iPad and Java?
Thanks!
A good approach would be to design your app to communicate with RESTful services that return JSON. Once this is done your iPad app doesn't have to even know that the server code is written in Java.. it's just interacting over HTTP.
Here's a good tutorial on setting up your tomcat to host your RESTful services: http://www.vogella.com/articles/REST/article.html - I've used this for an app I'm developing. Spring isn't even necessary.
You could go XML, but JSON is just easier in my opinion. Here's a good blog outlining the good and bad of both sides. http://digitalbazaar.com/2010/11/22/json-vs-xml/
OK, I'm making the following presumptions.
Your flex application runs on a different machine from the Tomcat
server
Your flex application makes web service calls to the Tomcat server
So, the flex application doesn't know the underlying technology that provides the web services. It's just seeing/consuming the output
There's no reason why the iPad app can't do the same thing. There's no reason why it can't use the same web services that the Flex application uses. It could consume the same messages (Assuming it can handle the request/response format currently employed by the Flex application).
You can make changes if you like if you want to change the structure of the requests/responses between the clients. But the clients don't know (nor care) how the web services are implemented. They are just requesting and consuming info.
I want to use JavaFx as a front-end in my web-application. My question is that is it possible to bind Model object with the form which is developed with Java Fx.
I kindly request you to put some light on this issue.
Please let me know If you need more clarification regarding this
The main differences between Web front-ends (like Spring MVC) and rich clients (and RIAs like JavaFX) is that for web front-ends the server-side logic runs in the same JVM as the web framework while for rich clients the server-side logic and the client are running on 2 separate JVMs, one on the server machine and one on the client machine.
Rich clients are usually downloaded/ installed completely before the user can run it, while for web front-ends each HTML page is possibly first dynamically created and then send to the user as needed.
Since the user usually already has the complete rich client from start, only the actual data (DTOs) get sent back and forth using some kind of remote service e.g Web Services.
So this means that the JavaFX client cannot access the objects of the server (e.g. attached JPA entities). You need to wrap the data up and send it to the JavaFX client using some kind of service (see the Service Facade and DTO design patterns).
The main difference between JAVAFX and any Java EE framework is same as the difference between the swing applications and Java EE apps.
You can design applications using JAVAFX to be directly used on desktop or deployed as browser applets with the help of the Java browser plugin. But, using it as a framework for designing the front end of a Java EE application is not possible.
Read this post :
https://www.java.net//node/674176
I have written a SOAP based web service which runs fine on a Tomcat server. The Web Service service itself is a Spring MVC based web service that runs on the Tomcat application server.
Now i need to write a Thick client which will be a standalone Java app that will use the services of the web service. I think i am correct in that the client only needs to know about the service details (i.e. operations) and nothing else.
What i am not sure of is the architecture and environment i should use for the client. The client application will be based on Swing but is it possible to use Spring with Swing together?
On the web service i have the following setup
view --> Service --> Model
The client application is basically a configuration tool. It uses the web service to configure user accounts. This means that the client application does not actually write anything to any database. It just uses the services of the web service to make changes to 'user account' and probably view list of accounts.
My question really is
- Is an MVC design suitable for such a use case
- Usually Spring is used for web based applications. Is there any benefit in using Spring with the Swing based client?
- Are there any alternative or better solutions/design/architecture that would achieve the same?
An example showing Spring used in conjunction with a Swing application would be very usefull.
Thanks in advance.
Spring MVC is not appropriate for a Swing-based client. Use the core Spring framework and a JAX-RS implementation like Jersey to provide simple REST web services in tomcat. Jersey also provides a corresponding client API that you can use within your Swing application to invoke the REST services.
If you have decided upon Swing as your platform, there are two options you can look at:
(1) Net Beans Rich Client Platform
http://netbeans.org/kb/trails/platform.html
(2) You can roll up your sleeves and write your own app using a low level yet extremely flexible framework called Swixml
http://www.swixml.org/
Give Swixml a good try before you try others, it may surprise you.
You can implement Swing-based thin client application with Spring Integration backend serving as a integration tier. It can expose gateways accepting simple Java types or DTOs. Your Swing presenters / controllers interacts with these components in order to call remote webservices.