Re: Automatic data generation
Re: Automatic data generation
- Subject: Re: Automatic data generation
- From: Florijan Stamenkovic <email@hidden>
- Date: Thu, 21 Aug 2008 13:57:21 -0400
Hi Ray,
On Aug 21, 2008, at 13:35, Ray Kiddy wrote:
I think it definitely would be fun. I have done parts of this. I
was once working on some app that did web template editing. It was
at some company that I have forgotten the name of. We wanted to put
in a smarter preview mode that would, for example, use sample data.
Needless to say, this did not see the light of day anywhere.
It would probably be best to parameterize the process in a couple
of ways. First, a plist-ish structure could supply actual data
values and these could either be used as-is, mixed and matched or
combined in different ways. For example, a sample data bit could
look like:
{ firstName = ("Bob", "Tom"); lastName = ("Smith", "Johnson"); city
= "Chicago" }
and this could be used to generate eos that are all the
combinations of these alternative values. For example, this would
generate 4 eos with the names "Bob Smith", "Bob Johnson", "Tom
Smith", "Bob Johnson".
I was thinking exactly the same thing. I was thinking of providing
value lists could be hinted to for individual properties, or if not,
random words, random values in general, can be used. Then a hint set
could be used to define preferences for attributes in which random
values are not convenient... Something like
Hints.add(Person.ENTITY_NAME, Person.NAME_FIRST_KEY, Hints.FIRST_NAME);
Hints.add(Person.ENTITY_NAME, Person.AGE_VALUE, Hints.lowBoundary(0),
Hints.highBoundary(120));
...
And the EO creation process would use a combination of models, hints,
value sets and random value generation to fill EOs up.
Second, you are probably going to want a rule list for constraints
on the generated data. Numbers need to be less than some value,
greater than some value, strings need to be less than some length
and so on.
If you did it this way, these structures could be kept in the
internal information of an EOModel and Wonder could be changed to
use them in a better preview mode.
If you want help covering different databases or such, let me know.
This kind of "EOF origami" can be loads of fun.
Well, if I ever get around to it I will contact you. My original
thought was to define values using java properties, but plists are
probably better. It'd definitively be good to brainstorm this through
before making it, who knows what kind of wild usages we could come up
with. It never occurred to me for example to integrate this into a
model, or wonder.
Thx
F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden