[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Design question

On Wed, 28 Feb 2001, Roy Ladner wrote:
> Falko Braeutigam wrote:
> > Working with the 'real object' is not a good idea in the ozone world too!
> > (since both have very similar basic concepts)
> >
> > Why do you need to access the target object? I'm still in the opinion that a
> > good design can help to avoid the need to access the target object. Am I to
> > idealistic about this?
> >
> I have read only data that I need to send to an applet via a servlet.  The ability
> to send the target object would seemingly simplify things.  I am not dealing
> solely with text here, but with fairly complicated mapping data (including
> coordinate information) that the applet uses to render a map.  Any suggestions on
> the best way to handle this in Ozone?

You can encode database objects in XML using the xmlForObject() method. Using a
XML representation of the object in the presentation layer has some advantages:

- XML is not the object; this will prevent you from using the data in an
unwanted way (manipulating instead of just presenting/reading)

- XML is as structured as the original object; further processing should be
easy using the SAX or DOM representation build by any XML parser; some
presentation layer technologies like to play with XML more than plain object

- via OzoneCOmpatible.toXML() it is possible to customize the schema of the XML
version of each database class; thus it should be possible to change the
database classes without the need to change the presentation layer too

Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com