[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Schemas: Best Practices
Curt Arnold wrote: > I always fall back on making some parallels with OOP concepts. Your last message is very interesting Curt. It made me realize that we have fundamentally different mapping sets in our minds, which accounts for why we differ on some issues. This may be worth exploring further as it may have implications on how to design XML Schemas. In Curt's last message he revealed how he thinks of the various schema components in terms of how they map to Object Oriented Programming (OOP) components: Curt Schema Component OOP Analogue ---------------------------------------------- complexType abstract class global element (schema scope) class local element (type scope) inner class As a consequence of this mental framework, Curt argues for certain design practices. For example, he argues against using type scoped elements as a default, just as he wouldn't use inner classes as a regular practice. Instead he encourages the use of schema scoped elements, just as would encourage use of classes in OOP. Given this mental framework, I can now understand his approach to certain design issues. On the other hand, I have a different mapping: Roger Schema Component OOP Analogue ---------------------------------------------- abstract complexType abstract class complexType class simpleType primitive type abstract element ??? global element (schema scope) global variable local element (type scope) local variable In my mental framework, it makes good sense to minimize the use of global elements, just as in OOP I want to minimize the use of global variables. And, in my model it makes good sense to maximize the use of type scoped elements, just like in OOP I use mostly local variables. In my last message I advocated separating the global elements into a private schema, and the type definitions into separate, public schema. In OOP, this is analogous to making the classes public and the global variables private. Until this point in time, it never occurred to me that there was another mental model. I am thankful to Curt for shaking me out of my narrow thinking, and awakening me to other points of view. I don't know which model is "correct" (is there such a thing?) What model do you have? /Roger
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|