1) Quote can be as simple as POJO, the contract is really just between Quoto and QuoteLoader.
2) Yes, Quote and QuoteLoader are automatically generated (from XSD) Thank *you* for input. On 8/18/06, Raymond Feng <[EMAIL PROTECTED]> wrote:
Hi, This is an interesting approach. I would recommend that you open a JIRA issue and attach all of your contributions there. Several questions: 1) Is the Quote a SDO DataObject or just a POJO? 2) Will the Quote and QuoteLoader class be automatically generated from the XSD? Thanks, Raymond ----- Original Message ----- From: Yang ZHONG To: [email protected] Sent: Friday, August 18, 2006 2:15 PM Subject: Please help to review a static loader design for static SDO I have a design/prototype for static loader of static SDO, any thoughts will be appreciated. Why static loader? One of the advantages is to incorporate schema into loader logic to save some time. e.g. <complexType name="Quote"> <sequence> <element name="symbol" type="string"/> <element name="volume" type="double"/> <element name="quotes" type="simple:Quote" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> The static loader knows one occurrence of "symbol" element is followed by one occurrence of "volume" element which is followed by 0 or many "quotes" element, therefore element names recognizing and dispatching are not necessary, element type is already known to parse literal value unless xsi:type specified or substitution used, property value can be directly stored through setSymbol, setVolume and getQuotes().add without the steps to locate and dispatch Property, so on and so forth. Here we apply the static loaders to StAX loading, later we can extend to SAX/DOM/JDOM if necessary. Static loader implements "StreamLoader" interface. A static loader may employ other loader(s). e.g. if "quotes" element is specified with xsi:type or substituted, the corresponding static loader needs to be employed before trying the generic dynamic loading. That can be done through passed-in "StreamHelper" contract/interface. A "StreamHelper" implementation can seek help from Loader Registry to locate desired loader then call "StreamLoader" contract/interface. A Loader Registry implements "LoaderRegistry" interface. Each scope can have its own "LoaderRegistry" instance. "LoaderRegistry" interface/contract is also used by "StreamLoader" implementation to register itself. My prototype provides a "StreamLoader" implementation named "StaticLoader" class which provides convenient helpers for real static loaders such as QuoteLoader. The prototype also implements both "StreamHelper" and "LoaderRegistry" in one "StreamHelperImpl" class. "StreamHelperImpl" extends from the existed "XMLStreamHelperImpl" class which is a generic dynamic loader, they potentially can be merged together although I personally prefer modularization. Sorry if you feel too wordy, I'm trying to make things as clear as possible. The attached Class Diagram may help. Source files and test case are also attached if interested. Thanks. -- Yang ZHONG ------------------------------------------------------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Yang ZHONG
