JSDC - Javascript data components
So, what is JSDC?
The main feature of JSDC is basically a set of classes that implements a dataset with data-aware editors and controls.
There are many other useful things that also can be used standalone but they are of minor importance, at the present.
A really small example(BTW, don't miss out on the code generator.):
I want to present and manipulate data in a nice table. This is, simplified of course, what i do:
-
I create a datatable-object to load and hold the data.
-
I create a dataview-object which points to the datatable.
-
I create a data_aware_object with kind "tableview" which populates a specified <table>-element with data from the dataview..
-
I call datatable.refresh()...
...and bingo! Now i can view and edit the data!
Ok... what does data-aware mean?
Say you have several lists of rows representing different selections of the contents of a table.
If the lists aren't data-aware, a deletion of a row in the underlying table does not affect the content of the lists displaying that row, they would look the same.
A data-aware list would act on a change-event from the dataset and remove that particular row from itself.
Of course, this also applies to other changes like updates and inserts.
But WHY does JSDC exist?
In the beginning for perfectly selfish reasons. I wanted to make a dynamic content web site capable of (some happy day)carrying really heavy loads.
But since my server probably dates back to the early fifties speed-wise, i wanted to move the database to the client.
So my four most important reasons were:
- Performance/Server load:
- Minimizing the number of requests.
I am actually down to one hit per page visit in the GI-calculator, an application built traditionally would require a database server and generate maybe 10-20 querys per visit.
-
Move the work to the client.
The application feels more responsive since the server roundtrip is eliminated.
With at least a fairly optimized query engine and a query cache(in these areas, i wouldn't mind some extra help at all), even Javascript performs.
- Bandwith:
- JSDC is currently easiest to implement using common csv-files(only thing implemented right now) for the data. It's like AJAX minus the XML overhead. Almost :-)
I will also implement a decompression functionality which would allow for compressed datafiles... That ought to lower bandwith usage even more.
- Administration/Security:
- IMHO, configuring a database securely while keeping important functionality is sometimes a nightmare. SQL injection anyone?
- Administrating and tuning databases and their servers for maximum performance is sometimes something of a black art, and something that should be minimized.
Let's not even get me going on DB-clusters, which i have both tried and failed.
- I thought that one should try and keep:
- public/application data (like lookup tables and similar): on the client for speed
- non-public/individual data (like personal data): on the database for security
-
Ease:
- To be able to easily build and advanced Javascript-based applications with views, lists and so on.
What is the difference between JSDC and ZK?
It is the completely opposite approach.
ZK is NO javascript(well, almost) and JSDC is ONLY javascript.
Some reasons JSDC chose this way are:
- JAVA is a is a proprietary de facto standard controlled by Sun Microsystems and some others. This means it is not an official standard.
JavaScript/JScript, or like it more formally likes to be called, ECMAScript, is an official standard.
- Javascript is supported by default by most browsers, there is no need for a JRE plugin (or licenses).
- Most web developers have fiddled with small JavaScript applications, it should be easy for them to understand(and find) the code.
- Zig007 thought JavaScript is underestimated and that it'd be way cool :-)
NOTE: This project is not actively maintained, however, parts of this project has moved to the Business Process Management System Optimal BPM. Check out that later on.