
|
 |

|
|
Session
Data-Driven Classes in Ruby
Michael Granger, The FaerieMUD Consortium
David McCorkhill, RubyCrafters
Track: Ruby
Date: Thursday, July 10
Time: 2:30pm - 3:15pm
Location: Eugene
Constantly evolving data structures present a challenge for the programmer. It is difficult to maintain a system whose attributes and behaviors change frequently or are not under the programmer's control. Traditional classes contained in files require corresponding changes in the code with each change in the data model. We examine methods of building classes, which reflect the structure of the data being abstracted. We start with a Factory Method, which builds extensible classes by querying a database for its schemas. This technique can also be used to define classes based on WSDL specifications (Web Service Definition Language descriptions of SOAP APIs), or to build parser classes, which autoload parsing methods from the rules of grammar. Finally, we demonstrate a system that uses data to represent both structure and behavior, allowing entire class hierarchies to be dynamically loaded at runtime.
Adds Granger, "This technique is interesting (to me, anyway) because it's a double abstration: it involves abstracting the idea of abstraction itself for a certain context. Meta-programming is 'cool.' Attendess will be able to apply
designs for code that adapts itself to the data it handles from this presentation to their own projects."
Download presentation file
|
O'Reilly Home | Privacy Policy
 © 2003, O'Reilly Media, Inc.
|
 |