Curt wrote,
> I really don't think you need to bother. The XML part is fairly
> simple; you have a bunch of attributes with names and values. From
> this you create objects with getter and setter method. Now come up
> with some reasonable way of representing the parts of the User-agent
> header you want to parse, and write a lookup method that takes a
> User-agent line and returns an appropriate object with the data
> for that phone. You're now done with the data representation
> portion.
I am not very familiar with the XML parsers (C++ or Java versions) provided by the Apache group (IBM's xml4j and xml4c are based on
these), but I wonder what performance difference there might be between (a) pulling the data straight from xml (probably via SAX)
and (b) returning data from a getter method in an object.
> Step 1: come up with a list of attributes of phones. Screen size
> in pixels and chars, colour vs. b/w, the obvious ones. Don't spend
> more than five minutes on this, because you can come back again
> later.
>
> Step 2: write a sample XML file encoding these data for a half
> dozen popular phones.
>
> Step 3: with this file in hand, write the XML stylesheet explaining
> how to interpret this file.
>
> Step 4: Create a Java object with getter methods for these data fields.
>
> Step 5: Create a Java object that, given the XML file, acts as a
> factory for these objects. But first write the unit tests for it.
>
> Step 6: You now have something useful, and a program you can run
> to prove that it works. Figure out what's missing, and add it.
> Repeat.
You need to add a step for parsing the incoming user agent for lookup and figuring out just what object to instantiate. This is not
as simple as it may seem since user agents of the same device can vary, such as by information added by the gateway (the case with
some ezweb phones). Here is a look at the new user agent string that will fly out of the SH08 in March:
> J-Phone/4.0/J-SH51/SN******(terminal serial number) SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0Ext-Profile/JSCL-1.1.0
Christian
Received on Tue Feb 26 12:11:10 2002