• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Convenience functions in model classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Convenience functions in model classes
      • From: Jeff Schmitz <email@hidden>
    • Re: Convenience functions in model classes
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Re: WODirectConnectEnabled=false again
  • Next by Date: Re: Inline bindings: attribute string value begining with $
  • Previous by thread: Re: WODirectConnectEnabled=false again
  • Next by thread: Re: Convenience functions in model classes
  • Index(es):
    • Date
    • Thread