• Subject: RE: HTML to XML, vice versa
  • From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
  • Date: Tue, 13 Mar 2001 23:45:11 -0600
  • Importance: Normal

I'm just going to throw out a few things here.  I suggest what you do is sit
back and think about the problem you are trying to solve.  My problem was to
take sets of data and display them, and that seems to be your problem as
well.  Some of the information about how the data displays is static, and
some is dynamic.  Static information includes things like field name,
length, description and so on.  Dynamic data includes field contents and
attributes (such as protect and error).  Attributes are more used for
interfacing between an end user and an application, so might not be an
issue, and should perhaps be a separate entity.

Okay, so in order to address this dichotomy, you immediately know you need
two classes: one that stores the static data, and one that stores the
dynamic data.  Then, the "model" which you will use to eventually create
your output stream (be it HTML, XML, or other) will be built one of two
ways:

An object holding the static data and a Vector of objects holding the
dynamic data
-or-
A Vector of objects holding dynamic data and a reference to an object
holding the static data

The former is fine for homogenous data, but I've found it very limiting in
practice, and so I tend towards the latter.

Given this relationship, your decorators will always have access to the
static data defining the characteristics of the dynamic data (this is
usually termed "meta-data" in SQL).  However, that begs the question of how
to define such data.  You can either hardcode it, load it from serialized
objects or retrieve it from the host.  It's your call.

Finally, I have a larger concept called an "image", which I use to hold
attribute information.  Again, this is designed more for end-user
applications, but I find it very useful.  An image holds error and attribute
information about a given record.

+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.