XML <=> database

vivek at cs.unipune.ernet.in vivek at cs.unipune.ernet.in
Wed Jul 16 13:43:11 CEST 2003


> 
> >   There will be a three tier architechture. One web application, Web Server,
> > one Application Server and the Database backend. The Web server will get the 
> > data as a XML document. This will be passed to the application server that 
> > will parse the document and will insert/Update/Delete the data in the database
> > Server. Similarly the data will be retrieved from the database and will be
> > converted in a XML document by the application server and will be send to the
> > user's browser through the web server.
> 
> One wonders to whom, exactly, this architecture seems like a *good* idea.
> An Application server which accepts things in a mock-SQL XML language,
> translates to XML and ships it off to the database? Why is that better
> than having the web server send SQL directly to the database? What,
> exactly, does the extra tier buy?
> [It's not flexibility if all it accepts is a mock-SQL XML language...
> writing SQL directly is probably easier.]
> 
> > I told him that we can use python for this purpose as there are a lot of
> > modules available for XML parsing in Python. And also it will be much easier
> > for Students to learn Python as compared to Java. Somehow I managed him to
> > think over it :-). But then he asked me :
> > 
> > 1. Is there something in Python which will work as an Application server like
> >    EJB ??
> 
> EJB always struck me as a particularily bad idea, sorry. *Why* do you think
> you want EJB?
> 
> > 2. He showed me the XML Integrator which is used in Java and which
> > automatically parse the XML document,convert it into a query string and
> > insert it into Oracle database backend. And while retriving data it converts
> > the retrieved data into a XML document.
> 
> Does it work with arbitrary XML documents? My guess is that it works with
> a very specific DTD [or Scheme, or whatever is fashionable today in the
> XML world]. It is probably not that hard to write something like that
> yourself, but something would already be written if someone found that
> DTD useful himself. I tend to doubt it.
> 
> Likewise, turning the database result into an XML document can often be
> done with a list comprehension and cgi.escape()...about 3 lines.
>

Can someone please post a sample code for doing this..
 
> The bigger question is what you are trying to teach your students. If
> the subject is "Three-tiered Applications with Java and Oracle", then
> it's doubtful you can use Python. If it is "Writing Web Applications",
> then I think that specing an internal architecture which seems way too
> complicated for most problems is not the way to do it. Why not give
> an exercise like "Write a blog" or "Write a shopping cart", and let
> the students design the architecture. You can, of course, mandate
> "outside requirements": "all the current stock must be kept in a specific
> Oracle table".

Actually we trying to show the students how to use XML+Web+Database as it is 
one of the hottest technology in the market :-)


> -- 
> Moshe Zadka -- http://moshez.org/
> Buffy: I don't like you hanging out with someone that... short.
> Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
> Agile Programming Language -- http://www.python.org/

THX and Kind Regards
Vivek Kumar





More information about the Python-list mailing list