|
|
|
|
A Developer's Perspective |
|
 |
David has spent the last twenty years building
enterprise software in databases and middleware, with long stints at Sybase
and Sun. David is currently the database architect for the NetBeans IDE,
where he is working on using integrated database intelligence to improve
developer productivity. |
|
Why
is the default answer always a web app?
By David Van Couvering
On one of our NetBeans mailing lists, a new programmer
asked a question, how should they build their application that needs to run
on ten client machines talking to a MySQL database.
The quick
answer was "build a web app."
I just don't understand this. The
web app architecture is - c'mon, admit it - ugly for applications that need
to have dynamic behavior (e.g. almost every app out there). It was never
built for that. HTTP/HTML is a static, document-oriented protocol and
markup. HTML came from SGML, which is all about documents and publishing,
not dynamic database-driven OLTP applications.
But the browser is
ubiquitous. It's the absolute best way to distribute a service out to many
people. Its the visual channel into the Internet. So we've worked with
it. Thousands of developers have grown up building apps using
HTML/CSS/JavaScript, session state, multiple tiers and so on.
But
it wasn't always that way. When I was fresh out of school, the browser
didn't exist, and we built simple client/server applications. The client
talked directly to the database using a database-oriented
protocol.
There were issues, of course, the primary one being how
to manage versioning and upgrades across thousands of machines, each with
their own operating system and versions, some of them sporadically
connected (e.g. on laptops). One of the key advantages of the web is that
you install it in one place, and everybody automatically gets the upgrade.
And it runs on everybody's machine. It's so cool.
But today there
is Java (write once, run anywhere) and Java Web Start (auto-upgrade to all
your client machines). They are mature and battle tested. If your
application is only going to run on the local network, there is
absolutely no need to create a multi-tiered HTML/CSS/JavaScript
monster. You can use traditional client/server, with rich clients written
in Java and deployed by Java Web Start talking directly to your database
using JPA/Hibernate/JDBC. You can use the visual design tools in NetBeans
or Eclipse to visually build your application. No hacking
<table><tr><td> garbage.
Having a middle tier
also allows you to disintermediate between the clients and the database,
which can give you a chance to improve performance and scale through things
like caching, pooling, clustering, replication and so on. But none of that
is needed when you have a small number of users, so why create complexity
when it's not required?
Now, if you're building an application to
be accessible over the Internet, or if you need to scale, it's a different
story. You need a middle tier, and one that speaks HTTP if you're going
over the Internet.
But even then you can use Java and Java Web
Start, and your client application can talk to the middle/web tier using a
service API. There is no reason why the server should be responsible for
composing the UI for your application. It can be a server, not a
UIer.
If you have Java antibodies, you can use Flex or
Silverlight. Or take a look at Cappucino.
There
are reasons why these RIA architectures are popular - they are meant
for dynamic applications and dynamic behavior, unlike HTML, which really
was never intended to be anything more than a way to display static
documents. With these RIA environments, finally we're getting back to
building apps with tools and an underlying architecture that match the
dynamic application paradigm.
Now, folks like Google want you to
keep building browser-based HTML applications, using JavaScript for dynamic
behavior to muck with the DOM (note their new
browser with superior JavaScript performance). Why? So they can scan
your text-oriented application and inject targeted ads. Not possible with
RIAs where the application is compiled into byte codes.
But just
because it works for Google doesn't mean it works for you or your users, or
that it's the best architecture. It's just the architecture we've had to
work with for the past fifteen years.
Now, there are times when a
web app makes sense, absolutely. The answer, as always, is "it depends."
But when someone asks you how to build a database-oriented app please don't
just default to "web app". There are other, potentially superior, options
out there...
Until next time,
David Van Couvering
To read
more of David's work, visit his blog.
|
|
| |
|
|
|
 |
most clicked this week from dzone.com |
|
Most-clicked links this week
|
|
|
| |
|
|
|
 |
A recap of
some of the most popular and active Javalobby.org
discussions this week. |
Exadel Fiji extends JavaServer Faces (JSF) by allowing the use
of Flex components within a JSF page. Fiji stands for "Flex and JSF
Integration." When using...
0
replies - 11351 views - 09/16/08 by maxkatz in Articles
When
your boss asks you to rewrite your application to be more performant and
handle
greater throughput, what do you do? Once
upon a time, when Moore's Law...
7
replies - 6860 views - 09/18/08 by Manik Surtani in
Articles
Yes, this is exactly what I am frequently asked by my clients
and many developers. It isn't easy to answer this question. There are
several projects using...
28
replies - 5940 views - 09/23/08 by Meera Subbarao in
Articles
I was introduced to easyb by none other than the creator of
easyb: Andrew Glover. In spite of hearing and reading a lot about easyb
from Andy, I never had a...
8
replies - 5465 views - 09/17/08 by Meera Subbarao in
Articles
The JSF Jumpstarter book is a short (67 pages), tutorial
introduction to JSF, suitable for new JSF developers. If you need to get up
to speed quickly with JSF,...
2
replies - 5157 views - 09/18/08 by John Ferguson Smart in
Articles
Having spent many years on different online communities and
forums, not least JavaLobby, I've noticed some trends about how developers
act from behind their...
14
replies - 4734 views - 09/19/08 by James Sugrue in
Articles
Last month I gave you an Introduction to REST. It was 100%
theory, so now its time to see a little bit of REST in action. Since
I am primarily a Java...
8
replies - 4493 views - 09/22/08 by Bill Burke in
Articles
|
|
|
|
|
|
 |
Product and
service announcements for Java developers. |
A new version of JFreeChart, a popular chart library for Java,
is now available. Version 1.0.11 features:
1
replies - 1744 views - 09/22/08 by David Gilbert in
Announcements
As part of promotion of "Practical API Design: Confessions of a
Java Framework Architect" and also in celebration of the 10th anniversary
of NetBeans...
0
replies - 1136 views - 09/24/08 by Geertjan Wielenga in
Announcements
yWorks announces yFiles FLEX version 1.3,
the new major release of its Adobe Flex-based add-on for their flagship
product,
the yFiles Java class...
0
replies - 985 views - 09/24/08 by Sebastian Mueller in
Announcements
GigaSpaces XAP 6.6 has been released. XAP, the eXtreme
Application Platform, is an application server designed from the ground
up to
scale out, with...
0
replies - 637 views - 09/22/08 by Joseph Ottinger in
Announcements
Free workshop to be held in Los Angeles/Anaheim, San Francisco,
Chicago, NY, and London. Software developers, QA testers, and IT managers
are challenged to...
0
replies - 623 views - 09/24/08 by Frank Cohen in
Announcements
New versions of these projects are available for immediate
downloads:
JLaunchPad 1.0.2. JLaunchPad (launcher) is the set of Java classes and
shell scripts...
0
replies - 614 views - 09/24/08 by Alexander Shvets in
Announcements
ItsNat, Natural AJAX, is an open source Java AJAX Component
based Web Application Framework. In this release, support for Google
Chrome, FireFox v3, Android...
4
replies - 579 views - 09/23/08 by Jose Maria Arranz in
Announcements
We are very proud to present not one, but two simultaneous
releases.
0
replies - 535 views - 09/26/08 by Jevgeni Kabanov in
Announcements
Aspose.Total for Java Q3 2008 release includes many new and
improved features in this java components suite. Now you can read and write
PPTX presentations with...
0
replies - 104 views - 09/29/08 by Usman in Announcements
|
|
|
|