473,721 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web architecture with javascript

I am faced with the task of porting a client application to a web
architecture platform, e.g. to make it browser based. The technology I
used was J2EE, e.g. servlets/JSP pages and HTML/javascript.

The application I'm talking about is displaying data from database in
grids, roughly speaking from 3 tables, that have parent-child
relationship between them, and when you click on a row in a parent
grid the content in the child grid should change.

I decided for two design patterns, that I'm now beginning to doubt,
which is the reason I'm posting this.

In order to make the design similar I created a javascript component,
Table using the rather awkard javascript notation for object oriented
programming. The usage of that table is similar to the table in Swing
or SWT:

Table a = new Table()
TableColumn b = new TableColumn(a," Column1);
b.setWidth(100) ;
....
TableItem c = new TableItem(a)
c.setText(["Text for column1","Text for column2"]);

The other design pattern was to use IFRAMEs extensively in order to
make the visual appearance similar to the existing client application,
e.g. that the whole page doesn't refresh, when you do a new query.
The main problem I'm having is that when the result set of a query
that is intended to be displayed in the grids is large, the browser
takes a lot of time just interpreting the javascript.

The general problem with using IFrames is that in order to achieve
correct synchronization between frames you have to resort to cross
frame scripting and unusual method of synchronization because the
programmatic submittal of form is an asynchronous operation.

So now I think I must rethink my design to move more tasks to the
server, and simplify the framing. I wanted to know if someone has
experienced something similar, and could provide some hints.

Regards, Halldor
Jul 20 '05 #1
2 1812
Halldor Isak Gylfason wrote:
I am faced with the task of porting a client application to a web
architecture platform, e.g. to make it browser based. The technology I
used was J2EE, e.g. servlets/JSP pages and HTML/javascript.

The application I'm talking about is displaying data from database in
grids, roughly speaking from 3 tables, that have parent-child
relationship between them, and when you click on a row in a parent
grid the content in the child grid should change.

I decided for two design patterns, that I'm now beginning to doubt,
which is the reason I'm posting this.

In order to make the design similar I created a javascript component,
Table using the rather awkard javascript notation for object oriented
programming. The usage of that table is similar to the table in Swing
or SWT:

Table a = new Table()
TableColumn b = new TableColumn(a," Column1);
b.setWidth(100) ;
...
TableItem c = new TableItem(a)
c.setText(["Text for column1","Text for column2"]);

The other design pattern was to use IFRAMEs extensively in order to
make the visual appearance similar to the existing client application,
e.g. that the whole page doesn't refresh, when you do a new query.
The main problem I'm having is that when the result set of a query
that is intended to be displayed in the grids is large, the browser
takes a lot of time just interpreting the javascript.

The general problem with using IFrames is that in order to achieve
correct synchronization between frames you have to resort to cross
frame scripting and unusual method of synchronization because the
programmatic submittal of form is an asynchronous operation.

So now I think I must rethink my design to move more tasks to the
server, and simplify the framing. I wanted to know if someone has
experienced something similar, and could provide some hints.

Regards, Halldor


Hi Halldor,

Javascript is indeed very slow when you need a lot of IFrames communicating
and you have many fields with names (you table-grid is not 4 by 5 I
guess...)
I once faced a similar problem, very similar actually, which was extremely
slow too.
I think my case was easier because I didn't need to add new rows and such
without refreshing, which makes thing easier.
I had a x by y grid that didn't change its size during interaction with the
user. But maybe this helps you going anyway:

The solution I implemented was just a one-page HTML + 1 hidden frame, no
Inner Frames, with named textfields (like col3row8) in a table.
When textfields were changed by the user, I had to recalculate some stuff
and update other fields (just summing and averages, done by Javascript).

When certain other elements were changed, I had to update a dropdownmenu eg,
and needed new information from the database..
This can be accomplished by using a hidden frame, where you can post your
changes and/or query your server, which in turn responds with the new data.
You have to make the response from the server in such a way that it will
call some javascrip-routine when loaded. This javascript must then update a
dropdown or something by adding and removing elements.

It is not easy and you can expect certain troubles when the user is very
active or the server slow with responses. So I blocked userinteraction with
the fields during these kind of updates, otherwise I would still have a
headage. :-)

I hope this helps you a bit.
Good luck!
Regards,
Erwin Moller
Jul 20 '05 #2
Halldor Isak Gylfason wrote:
I am faced with the task of porting a client application to a web
architecture platform, e.g. to make it browser based. The technology I
used was J2EE, e.g. servlets/JSP pages and HTML/javascript.
I'm using Tapestry, which is an extremely powerfull framework for creating
& running web-apps. It uses any standard web-app server on the frontside
and java and all that comes with it on the backend. Absolutely superior to
servlets/JSP.
The application I'm talking about is displaying data from database in
grids, roughly speaking from 3 tables, that have parent-child
relationship between them, and when you click on a row in a parent
grid the content in the child grid should change.
I'm doing something similar with a TreeTable, the size of which can be 5k+
rows or more (or less, but i'll come to that later).
It is also fed by a db.
Obviously i'm also dealing with parent-child relationships (going down to a
beforehand unknown level).
I decided for two design patterns, that I'm now beginning to doubt,
which is the reason I'm posting this.

In order to make the design similar I created a javascript component,
Table using the rather awkard javascript notation for object oriented
programming. The usage of that table is similar to the table in Swing
or SWT:

Table a = new Table()
TableColumn b = new TableColumn(a," Column1);
b.setWidth(100) ;
....
TableItem c = new TableItem(a)
c.setText(["Text for column1","Text for column2"]);

The other design pattern was to use IFRAMEs extensively in order to
make the visual appearance similar to the existing client application,
e.g. that the whole page doesn't refresh, when you do a new query.
I decided to use as much 'standard' HTML as possible.
So the table is known and all the data is encapsulated by numerous tbodies.
Allowing me to handle distinct 'sub sets' independently of the rest.
The main problem I'm having is that when the result set of a query
that is intended to be displayed in the grids is large, the browser
takes a lot of time just interpreting the javascript.
What i am doing is filling a js array (hashtable like structure) on the
server with the html required for the different rows.
Those entries are written to the screen using the document.write( )
function. The array is stored in a hidden frame (which acts as a function
library as well as data-repository surviving page-sessions).
One only goes to the server for updating (not sending anything back except
errors). Otherwise one just stays client side (also for state)
The general problem with using IFrames is that in order to achieve
correct synchronization between frames you have to resort to cross
frame scripting and unusual method of synchronization because the
programmatic submittal of form is an asynchronous operation.
When someting changes (or a branch get loaded dynamically) I just produce
the proper code on the server (remember the js array), replace the old
tbody entry with the new entry in the hashtable and write the structure out
to the screen again (respecting the old state).

One of the issues I had was the fact that the elements of a document in a
window loose their meaning once the doc is gone. You cannot rely on making
references to any element after the document is gone.

I noted that Erwin uses a hidden frame for server comm and update the
viewable document from there. Sounds fine to me as well. I guess it all
depends on the complexity and size of the structure and the parts to be
updated. I produce all my HTML via Java on the server and just write out a
string on the client. I'm not using any createElement(x yz) js function at all.
So now I think I must rethink my design to move more tasks to the
server, and simplify the framing. I wanted to know if someone has
experienced something similar, and could provide some hints.


One small thing though, i am using Gecko to debug my js. MS however tends
to crap out quite often of stuff which is supposed to be standard. So,
unless you don't care about that just keep it in the back of your mind
(would have saved me a *lot* of rewriting)

Goog luck,
Fermin DCG
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1897
by: Abdullah Kauchali | last post by:
Hi folks, (Need comments if you have done something like this before. Any response would be greatly appreciated.) We've recently been prototyping the idea of completely avoiding the server building the eventual/final HTML for the browsers. So far we've got this: 1. Create separate ASP pages that talk to the COM business components (say: businessproc.asp);
2
3282
by: Roger Irwin | last post by:
I have been browsing through the Mozzilla source and have been impressed at the level to which javascript decends. Clearly there is a lot of javascript that ends up embedded in the binaries and not as stand alone ASCII scripts. Anybody know how this works?
25
5614
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases - SQL Server, Oracle and AS400. The business layer exposes web services which communicate with the front end, ASP.Net. All 3 tiers are on different boxes. This works well. Now I am leading a team to build a winforms app. I need some advice as
6
1366
by: Michael Rodriguez | last post by:
If you're using a standard 3-tiered architecture, i.e. Data Layer-> Business Layer->Presentation Layer, where is the recommended place to put data validations? Specifically, data validations such as "Please enter a name." It seems like the best place to put them, from the programmer's point of view, is in the business layer. That way the same validations work for either Winforms or Webforms. Also, if I redo my interface later, I don't...
2
1363
by: Wee Bubba | last post by:
i started by designing my web page using frames. i had my data entry form in an upper form and my data rows displaying in a lower frame. i soon discovered that ASP.NET is not really meant for frames so I changed this to a single page with both the entry form and the display rows on it which posts back to itself(an improvement i hope?) ok my single page also needs to have the ability to search for stuff as you enter data. I know I can...
8
1215
by: CaptainDeep | last post by:
Hi all, I have couple of questions about architecting web application using asp.net 1. is ther any performance gain in using c# over vb.net 2. best way to handle transactions in .net? using ado level or COM+ 3. I have looked at MS Data Access Application Block - where you return DataSet/Data Reader as the value of the function - shouldn't that be by Ref ? Thanks in advance. CaptainDeep
6
3661
by: carsonbj | last post by:
I have an issue where the below operation works on a little-endian architecture but not on a big-endian architecture. I was under the impression that pointer arithmetic is architecture independant and bitwise operations are architecture dependant. The intention is to store two bytes, as chars, extracted from a short input parameter as: <code> void foo(short id_pair) { char *ptr = &id_pair;
13
7186
by: rrs.matrix | last post by:
hi i have to detect the type of CPU. whether it is 32-bit or 64-bit.. how can this be done.. can anyone please help me.. thanks.
0
1313
by: rsdev | last post by:
Hi, I am new to ASP.NET and I am trying to build a CMS application using theBeerHouse SK. I am adapting the Datareader to collect information from an SQL database and send it to an HtmlHeader. Using N-Tier architecture I keep recieving an object reference required error. Here's my code: Home.aspx.cs
0
9367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.