From: Justin F. <je...@ey...> - 2001-07-15 02:40:17
|
Aha. So it is for managing, er, what I might call "persistant" entities, and that means the database. This also looks good, having all that regex stuff/type_checking/ is_required stuff done for ya. Wonderful. Well, I was on a parallel universe. I was _assuming_ some kind of facility that was a framework that "facilitated" declarations of, filling of, walking of, array-based data structures. I have to let this sink in now. What I am finding is a "need" for a kind of data-structure- manipulator-class (DSM Class). I had some idea that the EntityManager was going to give me such a facility. But what I need is probably too specific for a "Manager". I find that I am slowly writing/adding to this DSM Class to do what I want, and shamefully, it ain't turning out too general. The explanation of this need is that I am writing a dynamic report generator, defined by a web form, and thereby letting the user define, not only the data sources, but the "look-and-feel" that the report will use, which will be determined by such a data structure. Then I can pass this around serialized, say, for the session. Or, if the user wishes to "keep" it, it can be written to some user preferences/profile table, maybe mapped to one or a set of reports, or all reports. And so the EntityManager will make that part easy. Man, this BC is like being given a harem for your birthday. You just don't know where to start (or end). _jef ------------------------------- Alex Black wrote: > > > Thank you John, for this answer. It clears up a lot of things, > > and I feel that it is going to be useful. > > > > What seems satisfying is that, if I understand correctly, is > > that if I need a data structure such as: > > > > $setup = array( > > 'table' => array( > > 'border' => "0", > > 'align' => "left", > > 'bgcolor' => "#CCCCFF", > > 'cellspacing' => "2", > > 'cellpadding' => "5", > > 'width' => "400", > > ), > > 'header' => array( > > 'bgcolor' => "#FFCCCC", > > ), > > 'row' => array( > > 'bgcolor' => "#CCFFCC", > > ), > > 'column' => array( > > 'bgcolor' => "#FCFFCC", > > ), > > 'other' => array( > > 'freshmeat' => true, > > ), > > ); > > > > that I, somehow, write this out in XML, and somehow, give > > it an identity/tag/handle/key I can somehow, declare it easily, > > (and it gets dragged out of ./ent ??), can fill it easily, > > use it arguments to other module method calls. It is > > appreciated that a lot of this effort will be offloaded > > at compile time and not run time. > > hi Justin, > > the above example isn't correct. > > here's a (simplified) example: > > entity: user > username > type => text > size => '20' > regex => 'regex_pattern' > field_label => 'User Name' > required => true > email_address > type => email > size => '40' > field_label => 'Email Address' > required => true > > so, you'll have a users table in your database - and it's good to be able to > do: > > EntityManager->Get(); with a primary key and entity, so you can get back a > set of data, or, if you are posting data, Entitymanager will enforce the > rules you defined: > > if you're Adding a user, the username and email_address fields must not be > empty - username has to match the regex provided, and the email address has > to match the standard email regex that's implicitly attached to the type. > > Entitymanager is _only_ for data access. > > > In any case, it sounds good. I will just have to wait, > > now, for the Stradivarius. > > best, > > _alex > > _______________________________________________ > binarycloud-dev mailing list > bin...@li... > http://lists.sourceforge.net/lists/listinfo/binarycloud-dev -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 |