Deciding among with Java technologies should use - beginner - java

I am not new to software developing, but in the last years I was almost completely involved with web applications development, most likely to PHP with MySQL/PostgreSQL.
Now I am changing focus. I would like to start programming for desktop applications, with Java. The decision about language was motivated by the following reasons: it is a mature language, has space into the market, it is multiplatform, full of resources, and has some very nice IDEs (I am using netbeans 6.9).
I am not new to OOP concepts (or most of them at least), but Java has a huge gamma of solutions (technologies, frameworks and so on), and I am getting lost with that. Can't decide what is the most appropriate solution to adopt and learn from.
That said, let's get to the point. I will describe the software targets, some things I has adopted so far, and expect someone to give me some trail to follow filling the messy points.
My application is a small business application. Usual stuff about products, sales, cash management. It needs to run into a small office, with some computers (not a fully standalone desktop application). Not every user can do everything. Some would have privileges to access financial stuff, others only sell, others only fulfill products, and so on.
Per above highlevel definition, we know that it will operate like a client-server application. One server will be installed into just one machine, all others will just have the client. I am using HSQL as backend for persistence.
Would like to use Swing to build the UI (to keep theming based on the OS). Possibilities for the client include sending email (not directly, but through some already-set email client [Thunderbird, Outlook]) and printing (to any available printer in the network).
For this I am using Desktop API.
Alright, finally we got were I am loosing the grip: which framework / technology do you recommend to make development quick (pre-built forms based on the available tables), and as modular as possible?
As I said, different users would have different privileges, but instead of just checking and disabling, I would like to keep modules separated. In different packs, or something like that.
EJB? BlueJ? JavaBeans? OSGi? Swing Application Framework? I'm kinda lost with those. Any help will be appreciated.

If you're lost, keep it simple.
For the kind of desktop apps you describe, you'll need Swing and JDBC. If you switch to web, substitute JSPs written using only JSTL and servlets. You'll have to know HTML and CSS to write JSPs. You can embellish those with JavaScript as needed.
You'll go a long way with just those.
The others you mentioned are just noise until you become more comfortable:
EJBs are for enterprise scale apps. You get to leave a lot of complex stuff like threading, object pooling and lifecycle, etc. to an app server and concentrate on expressing your business logic in distributed, transactional components called Enterprise Java Beans. Not necessary to start.
BlueJ is a beginners IDE designed to shield folks from the complexities of Java. I wouldn't recommend it.
OSGi - modular deployments for web apps. Not necessary to start.
Swing App Framework? I'm not familiar with it - I don't write Swing. If you mean Spring, I think it's an excellent framework, but not necessary to start.

This is a bit off-topic, but I think it should be said anyway.
My application is a small business application. Usual stuff about products, sales, cash management. It needs to run into a small office, with some computers (not a fully standalone desktop application). Not every user can do everything. Some would have privileges to access financial stuff, others only sell, others only fulfill products, and so on.
You are attempting something very ambitious here. There are countless existing applications for doing this kind of thing for small business, some of them household names. What makes you think that you can can do better? What makes you think you can compete?
The fact that you are new to Java makes this doubly ambitious.
My advice would be:
If you have dreams of making lots of money out of this, forget it. You are >10 years too late.
If you are doing this for some client, your company or yourself to use, they / you would probably be better off using an off-the-shelf business application.
If you are doing this for "the public good", you labors would be more fruitful if you joined some existing open source business application project.
If you are just doing this "for fun" ... go for it. (This doesn't strike me as a "fun" project though ...)

Starting off with java, swing desktop app is normal... I must say though that the components included in the default, i never liked, i thought they were too ugly. https://substance.dev.java.net/
Is a look and feel lib for java.
So do your app, think it through though and make sure you have some sort of design in mind.
Its easier and often faster if you have an idea of where you're going visually than if you just start coding and hope you reach somewhere you like.
Get paper and pencil out,scribble little notes and drawings of your GUI.
You don't necessarily need frameworks and the lot, if your app will need to store data then look at the JDBC driver to connect to mysql, or have a look at embedded databases such as HSQLDB...

Related

Java libraries and frameworks overviews

Which web sites could you recommend, where I shall find overviews of different java libraries and frameworks that are currently preferable to use in development of applications?
update: To be more precise, I've liked to find a site that will be like a magazine about java, where will be the overviews, comparisons, best practices, examples and other useful information about java (technics, libraries, frameworks and so on) for different purposes. The aim of magazines is not to cover all the things of their subject area, but to present more actual, interesting and useful things only.
I really like the design on Open Source Software in Java. They've got it laid out by type to start with, plus when you dig down you can find several competing projects for each category.
For example clicking on 'HTML Parsers' gives this (and more - this is just a partial clip):
I hope this helps.
The world of java has so many libraries that it would be practically impossible to recommend anything without some kind of understanding about what kind of application you are actually writing. Are you writing a blu-ray disc, a game for a java phone, an android app, a desktop application, a server side computation process, a web service, a web site.... the list of things that java can and does do is huge.
The same thing goes for frameworks too. I would always say (although many people on this site disagree) that you should only look for a framework when you are finding something difficult, and the framework makes that thing easier, without making other stuff harder. Some people say you pick your framework first.....
Perhaps if you gave more details on what kind of thing you were trying to attempt, the community might be able to point you towards some useful stuff.
As a side note, remember that the internet is full of people with opinions - just because they are loud, it doesn't make them right - after all http://en.wikipedia.org/wiki/On_the_Internet,_nobody_knows_you%27re_a_dog

What's the limit of BONITA Platform ? Can a Business Analyst generate a whole Java Web App with just pre-programmed connectors?

I'm studying some systems that allow faster App dev cycles. So I stumbled upon BONITA. It seems that by preparing some connectors you can allow a Business to generate a whole App.
What's the limit of Bonita and what is needed to improve it ?
Bonita is one of probably many Business Process tools. Like all such tools there are good and bad things. Yes they allow some business processes to be automated by users by dragging and dropping components, or process steps in some sort of GUI. And like systems, say SAP for example, if you fight precisely in the SAP box it can get you going much faster and easier. I've never met any business that fit "exactly" in the SAP box though, and usually there are years spent customizing it. In my experience, the users usually give up on this after a while and want developers to do this for them when they experience something that doesn't quite do what they thought it would. The developers try it out, become frustrated with the limitations or just get overwhelmed by NIH syndrome, and the tool is soon abandoned. Alternatively, and perhaps more concerning, is when you get the true user enthusiast that quite innocently takes down a production database in the middle of the day trying to look at their data in new ways, but without training wheels.
YMMV
Actually I'm evaluating Bonita Open Solution (BOS) for internal use in small company and I think it's a great platform to build workflow applications on. I believe that a manager having basic BPM knowledge can quite easily prototype the whole process including user interaction forms, some of process variables and condition on flows, and simulate anytime with one click. Since you're modelling application, you can completely reorganize the flow when optimizing process. Anytime a programmer can come and implement interactions with external services using connector, again not a hard thing. Once you are ready, just export application and deploy on server.
Bonita has simple but powerful Java API. Accessing it you can tweak most limitations.
Nice thing about Bonita is it's active development. Also forum is quite supportive and even the developers of BOS answer the questions in a short time (hours or few days on weekends).

How do I decide between a using a Swing GUI or a light-weight web client for the user front end of my Java application?

I always seem to have this internal struggle when it comes to user interface. I build up an application "engine" and tend to defer user interface to after I get my algorithms working. Then I go back and forth trying to decide how to let a user interact with my program. Personally, I'm a fan of the command line, but I can't expect that of my users generally.
I really like what's possible in the browser in the age of web 2.0 and ajax. On the other hand it's not so hard to make a Swing front-end either, and you can generally count on a more consistent presentation to the user (though using a good javascript framework like YUI or jQuery goes a long way toward normalizing browsers).
Clearly both approaches have their merits and drawbacks. So, what criteria / parameters / situations should lead me to use a lightweight (e.g. web-based) GUI? What criteria / parameters / situations should lead me to use a heavier (e.g. Swing-based) GUI?
It is not my intent to start a flame war, merely interested in the community's constructive/objective opinions.
Edit #1
In light of the first few responses, I would like to clarify that I would like to deploy my application regardless, not host it on some internet server necessarily. So I would have to deploy with a light-weight web-server infrastructure a la Jetty/Tomcat or similar.
It depends on the application and this is essentially a usability driven question (though there are considerations like data storage and platform requirements). Think of the pros and cons.
Pros of a lightweight Web UI:
Ease of distribution
Platform independent
Ease of maintenance
Cons of a lightweight Web UI:
Less environmental control
Markup standards vary between browsers
Requires a web server and everything that goes with it
Pros of an executable UI
More environmental control (i.e.: full screen applications, etc)
Not necessarily subject to latency and outages
Cons of an executable UI
Pushing updates may be more difficult
Requires installation
Potential platform requirements (frameworks, packages, etc)
Potentially requires knowledge of advanced networking topics (web services, etc)
One small factor you may want to consider is that the user will have go through some type of installation (albeit minimal) if you distribute a swing application.
Also a web application will allow you to accurately track the usage of your application (via google analytics or something similar). Not sure if that's a concern but it may be useful to you in the future.
If it is a client-server application I would normally go for a web frontend for the application.
You will save yourself of countless problems with things like installed JRE versions, distributing upgrades, application permissions, disappeared shortcuts...
You need to break the requirements of the application down to decide this...
Do the users have Java of sufficient version installed? It will need to be, to run a Swing GUI.
Do you have a web server?
Do you need the flexibility of a Swing GUI or the accessibility of the web interface?
Is Java Webstart and option, if so, you can distribute a Swing GUI via the web.
Does your application perform extensive calculations or processing? If so, a client app may be the answer.
There are a million questions such as these. I would suggest a brain storming session and keeping track of all the pros and cons of each, adding a point score, than throwing it all away and going with your gut feeling :)
If you anticipate there being frequent updates to the app then web based may be better since the user would not have to update the client or install a new client containing the updates.
If you think that the user may need the ability to use the app while not conencted to the internet then swing would be better.
Just two things off the top of my head.
Think about the users and use cases of your project.
Do users expect to have access to it when they're disconnected from the Internet (for example, on an airplane or in a coffee shop with no Internet access)? Use Swing.
Do you want users to be able to access the same tool from different computers (for example, both at work and at home)? Use a web UI.
Also consider whether the user needs to save and load data, and whether the tool produces data files that some might consider sensitive (if so, storage on the web might be an issue).
Do make a quick guess I often try to ask myself/customers if the application has a high "write" demand.
For a mostly read-only application a thin-client solution is perfectly well suited.
But if a lot write actions are needed then a swing desktop application has more flexibility.
Personally I always prever a swing desktop application. It can easily deployed using Java Webstart.
Not knowing anything about your application I can not give the best recommendation possible. However I can state from personal/professional experience that installing an application on clients machines is a LOT more of a pain in the ass than it seems.
With AJAX/web you really only have to worry about supporting like three browsers. Installation messes/updates are only felt once when you deploy the product to the web server.
With like a stand-along Swing app, you get to deal with the really really big mess that is installing the application onto unknown systems. This mess was so bad that things like AJAX were really pushed along to make web apps behave/feel like a real native app.

Adventures of a Web Programmer in Applicationland (or, Practical Java Help Needed)

Alright, so I am a compsci college student who, being in college, has not branched out towards a certain specialization yet. I have been programming since I was a young teenager, certainly know my stuff - well versed in about eight different languages as well as compsci theory, etc. In addition, I have about four years of web programming (PHP mainly) behind me, having started freelance work in that area since web 2.0 became hot.
My summer job now as an intern of sorts is to write an application for an industrial, not software-related startup. This application will be used to manage production lines and logistics flow. I have chosen Java for my language because I don't want to shoot myself in the foot.
I am well-versed in the syntax of Java, in its data structures, language theory, and such, but I have absolutely no idea where to start. I can picture the program perfectly in my mind, I understand the problem clearly and got the solution's theory nailed. Namely, I have no idea what libraries to use, and am scared that they won't be well documented.
Here are some general outlines of what I'm going to make:
Two applications, one server and one
client (of which there will be many
copies).
The server and clients obviously will
communicate via (I don't know).
Both the server and the client
software will have GUIs.
The server software will have to
query a MySQL database.
The client software must be 'live' in
the sense that the GUI updates when a
change is made to the database. This
is one of the reasons why it can't be
a web application.
I'm not even sure if a framework is right for me or not. I've used MVC tons of times in my web freelance work, but I dont know how that will translate for desktop applications.
In short, I'm looking for the right libraries for the job, as well as advice on whether or not I should use a framework (and if so, which). Thanks.
This is a summer intern job? To be honest, this sounds more like a major project if you ask me. You say the start-up is not software related? Who came up with this idea? Do they have any idea of the (huge) scope that something like this might actually entail?
The business of software development is something quite different to language syntax and libraries. It's about requirements gathering, defining a spec, writing code, ensuring quality of that code, having it tested and so on. These are not things an intern should reasonably be expected to pick up. For something like this you should be under more experienced supervision, someone you can learn from, someone who has done this before.
That being said, unless there's a really good reason, I would probably do such a thing as a Website rather than a desktop app. Desktop apps are a lot more complicated in many ways. You need to code both a client and a server. Communication is a bit trickier. You have to worry about the issue of maintaining state in multiple applications, how to handle updates being pushed around and so on.
In short, it's a big job. Even a Web site is a big job but a lot of these issues go away. You could do this with Java. I've certainly coded my fair share of Java Websites but PHP might be a far simpler bet.
Also, desktop development on Java is, well, torture. Swing is (imho) tried and true but also incredibly painful to develop in. Other desktop libraries (eg Netbeans RCP, Eclipse SWT) are more modern but have other idiosyncrasies.
Desktop remoting libraries include things like Spring remoting, even Web services and other things like Burlap. For the server side, I'd be using either Tomcat or an application server (Glassfish is my preferred choice), servlets and Spring. Persistence can be done via Hibernate or Ibatis (or lots of other options).
But honestly, the desktop option is so much more complex than a Web-based one. You'd probably get a lot more done faster using PHP + jQuery + MySQL.
If you are doing this keep it as absolutely simple as possible. Try to define the absolute minimum you need to initially deliver and do that. Once someone has that they'll then have a better idea of what works for them and what doesn't. Basically it's easier to refine something that already exists vs define something that doesn't.
I recommend that you only build a web application. A web application can be 'live' in the sense you are describing it by using AJAX. It would be much easier to build just one thing. If you also want to have a rich client, then you need to build the UI in a technology you are not familiar with (like Swing or SWT) and design/implement the communication mechanism.
Have a look at Hibernate (ORM tool) and Spring (IoC framework). They have a somehow steep learning curve, but they will make your life easier at the long run. For the UI part perhaps JSF is easier for a beginner.
As a last note, I think you have an over-ambitious plan. What you are describing is not an easy project and requires expertise with a lot of technologies. Do not try to do everything in one shot.
Java Desktop 6 (JRE)
JDBC (built-in in any JRE)
MySQL JDBC drivers (freely downloadable)
for communication you have several choices: RMI (built-in) however this days I recommend
learning something like Java Web Services (JAX-RS)
Libraries?
JDBC for the database. You may want to look at ORM mechanisms like Hibernate
I would recommend the Apache Commons libraries for all your utility work (handling files, IO etc.). There's a lot of stuff there to save you reinventing the wheel.
A standard logging framework like Log4j will allow you to log in lots of different ways, filter your logs and plug into monitoring solutions easily.
You don't say whether browser-based solutions are acceptable for the client/server GUI, and that decision will drive a lot of the further architecture.
If you're looking at browser-based solutions, then I would advise a grounding in servlets regardless of any framework you ultimately choose (no doubt a lot will be recommended here).
By this stage it's getting to be a major project. Perhaps you need to concentrate on getting the fundamentals (client/server functionality) working, and worry about the GUI later. Otherwise it's a huge amount of work (and GUI work can draw an enormous amount of time).
Just one nitpicking:
Both the server and the client software will have GUIs.
I advice you to have a headless (in awt parlance) server, with an administration GUI, not a GUI-server.
Well this can go as wild as you can think of or you can go and do KISS.
If you would like something that is really simple (as in not using any frameworks):
* In the server side you can use RMI. This server side will use plain JDBC to connect to your MySQL database. But some said that this is kind of old, so if you want to get funky you can try JAX-RS which can return a JSON objects/XML to your client.
* Your client can be made using Swing (assuming you are developing desktop) or Servlet + JSP (assuming you are developing webapp) and connect to your server by calling the RMI objects/JSON objects/XML that is exposed by the server.
If you would like to get nasty which will help you in terms of code maintainability you might want to plug-in Spring + Hibernate into this application.
Good luck!

Pylons or TurboGears vs. .NET or Java

We're embarking on a project for a client. They plan on having about 50k users by the end of the year. We're pushing to use Pylons w/ Mako and SQLAlchemy, and our contact there is excited about it, but some of his colleagues are wary because it's not .NET or J2ee (they're used to enterprisey stuff).
Their web app will have some data analysis that we'll offload as well as a twang of social networking features. (basically all they have so far is some Flex mockups for UX)
I'm looking for some evidence with regard to development time, or other reasons that will help our argument to reassure the customer.
The other options is that we're barking up the wrong tree and have no idea. I hope that's not the case.
Any references to case studies or whatnot would be nice. The best I could find are
http://www.oracle.com/technology/pub/articles/rubio-python-turbogears.html
and
http://www.oracle.com/technology/pub/articles/devlin-python-oracle.html
which are a bit dated (wrt to TG2 and whatnot)
Thanks!
If you're looking for a success story for a customer, Virgin Charter is using Pylons with SQLAlchemy for their site. This is a high-value transaction system as people are booking very expensive flights through the site.
For a more high-traffic site, Reddit is now running on Pylons, along with Charlie Rose.
SQLAlchemy and Mako were both designed by Mike Bayer (A veteran Java programmer), SQLAlchemy being based on the best of Hibernate and with the same powerful principles and patterns that Hibernate supports.
If they're wary of deploying something they're not familiar with, Pylons runs on Jython, and the latest SQLAlchemy (0.6 branch) is about ready on Jython too. This would let you package up a full Pylons app into a WAR file for deployment which would reassure their Java-types.
For general Python, consider pointing out all the big animation studios that use it, and the other various srouces S.Lott points out.
It's almost easier to build a quick Proof of Concept service that demonstrates how clean and simple it is.
A simple SQLAlchemy mapping with a quick demo of query processing.
A simple template showing how cool Mako is.
A simple Pylons app to put the two together.
Most important -- use their application and their data. Not a lame hello world; not an existing tutorial.
If they want to compare your clean, elegant demo of their app with .NET and J2EE, they'll see that other languages lead to a much, much bigger code base.
Edit
Show them this: http://python.org/about/success/
Also, one of the best Python demos is to do things the way the SQLAlchemy and Django tutorials do things -- in interactive python from the >>> prompt. Nothing is more exciting than programming which is so simple you can do it interactively.
You won't find a lot of compelling case studies. Python is a community. .Net and J2EE are products. .Net has Microsoft's advertising backing it; Microsoft can afford to do extensive surveys and studies of their product. Same for Sun (soon to be Oracle) and J2EE -- lots of marketing hype backing up their claims.
Python just has what's on the Python.org site (http://python.org/about/). The various related projects (Pylons, Mako and SQLAlchemy) don't have lavish case study whitepapers. They do have a large number of downloads, and lots of word of mouth.
But if someone's looking for "proof" that Python works better than .Net, there's not going to be much.
They are crazy if they want to use j2ee imho. Visual Studio/C# is very nice, especially if you are not trying to do anything tricky. However, if you want to customize the C# way of doing things beyond what it was explicitly designed for it can quickly turn into a mess -- you get mired in automatically generated XML configuration files &c. Of course, I also think that Pylons with SQLAlchemy might turn into a mess because they too generate so much stuff that you ultimatly might end up having to reconfigure. If you want complete control, I would recommend a less intrusive environment, like Werkzueg. Please read my essay on writing MVC with no invisible means of support.

Categories