Convenience functions in model classes
Convenience functions in model classes
- Subject: Convenience functions in model classes
- From: Jeff Schmitz <email@hidden>
- Date: Fri, 4 Apr 2008 23:50:27 -0500
Hello
As I get rolling down the EO highway, I find myself wanting to put convenience functions in the model classes that are generated by the EOGenerator (yes, I'm using the generation gap classes for this). e.g. to more closely mimic indexing a two dimensional array like the "old" way I used to do things, I create the following to retrieve a Game object from in from a model class that contains a one to many relationship to Game objects:
public Game game(int group, int gameIndex) { EOQualifier gameQual = Game.GROUP.eq(group).and(Game.GAMEINDEX.eq(gameIndex)); Game game = this.games(gameQual).objectAtIndex(0); return game; }
Is this a good thing? Just hoping to get some feedback before I go too far down this road.
Thanks, Jeff
|
_______________________________________________
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