JAVA EE Application server in Desktop app? - swing

I´m currently looking for a solution to write a JSF application inside a Desktop app.
I think I can use:
Start Main function
Start SWING application
Start JAVA EE application server
Start database (e.g. H2 database)
I found the following solution with Tomcat:
https://www.beyondjava.net/how-to-wrap-bootsfaces-or-jsf-in-general-as-a-native-desktop-application
This is exactly which I would like to have. The only problem is, that Tomcat needs approx. 20 seconds to start.
Is there any other Application server which I can integrate like this in the Main class which will start than the Web application inside the SWING Gui?
Many thanks

In general, putting a full-fledged JavaEE application inside of a desktop application is a bad idea. You have only one user working on a local machine, and the JavaEE platform is intended to be used in a concurrent environment to process multiple parallel requests coming from different clients over the Internet. A lot of facilities and trade-offs inside the JavaEE platform are implemented to support this. Using it to serve a single user on their local machine is like hammering nails with a microscope.
This is also a clear contradiction between your goal (quick startup of the desktop application) and trade-offs of a JavaEE application (the startup time doesn't really matter so much, as restarts happen rarely).
It's also worth to say that Tomcat is not a JavaEE server, as it doesn't provide the full JavaEE implementation. Although you definitely can run JSF applications on it by providing a JSF implementation inside the application itself.
If you really want to proceed, you could take a look at jetty as a somewhat faster alternative to Tomcat.

Related

Rails or node.js for Restful API

I have an existing website written in ASP.net, I have recently switched to Mac full time (With Windows in Boot Camp), and need to write a public API for accessing my website's MySQL data. I primarily want to use the API to allow building an iOS application.
I am interested in learning either Ruby on Rails or Node.js, I haven't used either of them yet.
Which language would be better for me to learn?
Rails is a relatively mature web framework based in Ruby and is designed for handling object-mapped data persistence in a relational database backend.
Node.js is much newer on the scene, and unlike Rails, is a more bare-bones package that allows for server-side Javascript applications thanks to a pretty tight HTTP(S) API. Node applications are by nature event-driven, which may or may not be ideal for your application.
Since it seems that you'll need data-persistence (you mentioned accessing MySQL data...), Rails might be easier to get started with, as it comes packaged with all the things you need in this respect and is designed to facilitate this sort of application.
If you you don't really need relational data persistence, Node is probably a better bet as it stays out of your way and lets you decide how to handle things. It's important to note that Node is a much more bare-bones "framework" than Rails -- if you want something slightly higher-level but still lighter than Rails that runs on Node, express is good place to start.
Still, if you want to try Node (I will confess: it's a lot of fun!), it's totally possible to access MySQL in a nice, event-driven (non-blocking) way. Here are two modules that will be helpful:
node-dbslayer
node-mysql
Neither is a language; they're frameworks. There is no "better", there may be a "more suitable" (probably not in this case).
Which would you prefer to develop in, Ruby (Rails), or JavaScript (node.js)?
Would you like to transfer that knowledge to a different job without rampup time (Rails)?
Would you like to learn something a bit more esoteric, event-driven (node.js)? (Ruby has Event Machine, but IMO node.js takes it a bit further.)
So this new application is just a middle man between your ASP.NET thing and your other clients.
In that case, totally use node. Node is great at being networking glue. Node scales great with IO bound applications (i.e. being a network middleman).
If you're going to use node then you probably want to look at express to make it easier.

GUI Development - Free Tools

We are looking at building a GUI application having the following attributes -
* approx 100 screens
* approx 200 users
* interfaces with 8 different legacy applications (protocols tbd but we are assuming web services will be exposed)
* has a separate data store for storing authentication and authorisation info along with few other information.
We are trying to avoid spending any money on procurement of physical servers, application servers etc.So we thought instead of building a web application , we could develop a standalone GUI based application that could be deployed on users' desktops considering that the users are less and the access to this application is confined to our organisation.
We were thinking of Java Swing as one of the options to consider. Is it a good choice? Please advice on the other options that we need to think about. We thought MS products would involving licensing costs to buy the product hence we are looking at developing the application using some free software tools.
Thanks a lot!
Regards,
V
I really like Swing and have written many applications with it, but I'm not sure the argument that you will get a cheaper solution because you have to procure less physical servers is a good reason for it.
There are other ways to use computational capacity on the client side. For example you could use SmartGWT. With a browser based solution you get easy deployment and have no problems with client-server communications (i.e. no proxy hell). It's possible to get all of this solved with a standalone GUI, but it requires experience and time (== money).
I think a standalone GUI is a good idea if you need a "rich" user experience and tight integration with the native environment. Web apps are generally less snappy and not so well integrated. If it's just about editing data on a server, the standalone GUI does not really have any advantages.
I won't rehash what we talked about in the comments. It seems you are focused on java gui solutions. With that said there are alternatives for developing gui applications with free tools. Just to name a couple, you could develop your client with Adobe Flex or Adobe Air, use python, php or ruby and GTK, or develop a windows GUI app using c# if your target os is windows. Similar to Air, Microsoft Silverlight is an option. Java is not the only solution.
Many Java gui apps are written using swing. The major competitor to Swing has long been SWT which is used for eclipse and by IBM. Javafx is a newer/alternative platform Sun/Oracle is behind, you should also look at. To be complete, you should also take a look at qt jambi that lets you develop in java against the Qt framework.

What's the alternative for hta (HTML apps)?

I have to convert a HTML application (.hta file) so that it can be executed on Linux and MAC also.
What could be the alternate ways of doing it? Should I convert to an AJAX app?
Any suggestions? OR Has anyone gone through this before?
Reagards,
/Syed
Though you have not provide the nature of application. I mean what you application does.
What I get from question is since you are using HTA application that means you application requires system level access. Now since Linux and windows are completely different platforms. It is not possible to complete port one app from one platform to another.
If you can work at the plugin level like development of flash-plugin or you can use the Adobe AIR to build your application.
I mean to say don't use Microsoft native code in you application.

fastest public web app framework for quick DB apps?

I'd like to pick up a new tech for my toolbox - something for rapid prototyping of web apps. Brief requirements:
public access (not hosted on my machine) - like Google's appengine, etc
no tricky configuration necessary to build a simple web app host
DB access (small storage provided) including some kind of SQLish query language
easy front end HTML templating
ability to access as a JSON service
C# or Java,PHP or Python - or a fun new language to learn is OK
free!
An example app, very simple: render an AJAXy editable (add/delete/edit/drag) list of rich-data list items via some template language, so I can quickly mock up a UI for a client. ie. I can do most of the work client-side, but need convenient back end to handle the permanent storage. (In fact I suppose it doesn't even need HTML templating if I can directly access a DB via AJAX calls.)
I realize this is a bit vague but am wondering if anyone has recommendations. A Rails host might be best for this (but probably not free) or maybe App Engine, or some other choice I'm not aware of? I've been doing everything with heavyweight servers (ASP.NET etc) for so long that I'm just not up on the latest...
Thanks - I'll follow up on comments if this isn't clear enough :)
C# or Java,PHP or Python - or a fun new language to learn is OK
How 'bout Javascript? This place hosts server-side Javascript ticking most of your other boxes. So you can use the same language for client- and server-side stuff (which I find very handy). [Caveat: I only played with their service; seemed cool though. I use Javascript on the server-side on IIS and on Tomcat (via Rhino).]
For something bleeding edge - A new version of spring roo was released recently. With it you can create a great web app in 10 minutes. Supports GAE and GWT...
http://www.springsource.org/roo
xataface is a quick way to make a front end for a MySQL database.
It makes it easy to start an app quickly with dynamically created views and then you can change it to something very customized to your needs.
It simply needs a server service with MySQL and PHP.

What is a good choice for a free Flash Socket Server

I see Red5 which looks nice but it really lacks documentation and since I'm new to using sockets it would be a hassle.
I'm wanting to make a flash chat with audio/video (though just text will work at first) and I enjoy ES but the cheapeast license is $700! I'm a solo developer so the cost is too high.
The main factor is just having good enough documentation for a new comer.
(I use the flash CS4 IDE if that matters)
SmartFoxServer is a good choice. I played around with it a few years ago with AS2, so might be work a look.
They offer a free lite version, but it does not support AS3. I think you need to get the basic plan for that. The pricing plans do look well priced though.
They have some nice documentation and plenty of example.
SmartFoxServer seems to be targeted at multi-player games, but it could be used for your needs.
EDIT*
Just found these Beta AS3 classes for SmartFoxServer. I haven't tried it out for my self though.
EDIT 2*
Another option would be to make your own. It's probably easier than you think if you have a few programming languages under your belt. Of course, this is the kinda thing that can suck your time away.
There are a bunch of tutorials out there for building your own socket server, and some are even specifically for flash. Here are some of the best:
Building a Flash socket server with
Java in five minutes
Python socket server for Flash
XML Sockets / Flash / PHP Based Chat App
Writing Socket Servers in PHP
Asynchronous Socket Programming in C#
I would definitely suggest using C# .net if you have Windows hosting. It would definitely be the simplest to build and would have the best performance. I would stay away from PHP for anything bigger than a chat app, but if that's all you have then go for it.
Try Union. IT's written by one of the best actionscript programmers out there, Colin Moock. The options seem affordable and it's well documented as well.
You can get a free flash socket policy server from https://fsps.rpath.org. I built this appliance for internal use at rPath where I work, but I also maintain it on our free rBuilder Online service. Just click on the Home tab, and download the type of appliance you want (ISO, vmware image, etc.). The Appliance is a full system image including the OS (in this case rPath Linux 2) plus the fsps application.
The policy service resides in the fsps package and runs on the standard Adobe port of 843. By default, it only opens up access to port 443 on the system (https). The policy file served up lives in /usr/share/fsps if you want to change it.