Ok i dunno if I understand good, but as for teh 7 tips you post I
think I following them, as for the line... well the veogen generated
this
public DisplayBoard localInstanceIn(EOEditingContext editingContext) {
DisplayBoard localInstance =
(DisplayBoard)EOUtilities.localInstanceOfObject(editingContext, this);
if (localInstance == null) {
throw new IllegalStateException("You attempted to localInstance
" + this + ", which has not yet committed.");
}
return localInstance;
}
and I guess if I put the new line you suggest I must implement the
newDisplayBoard (EOEditingContext) and formt here call the
localInstanceIn()method which resieds int he _DisplayBoard class,
which it looks for me like a singleton pattern.??
Gus
On Mar 12, 2008, at 4:24 PM, David LeBer wrote:
> On 12-Mar-08, at 5:21 PM, David LeBer wrote:
>
>>
>> On 12-Mar-08, at 4:46 PM, Gustavo Pizano wrote:
>>
>>> Hello guys.
>>>
>>> Well, finally after "solving" ( i dunno yet if its gonna worl the
>>> solution or what) the problem with the "execute SQL" Im going
>>> trough the tutorial, IO read I should use the Veogen due that im
>>> under leopard. so I did what the wiki says
>>>
>>> http://wiki.objectstyle.org/confluence/display/WOL/Velocity+EOGenerator+%28Veogen%29
>>>
>>> no problem there.
>>>
>>> so comparing the sample code I downloaded from the site where the
>>> tutorial resides and with the code generated (DisplayBoard.java
>>> and _DisplayBoard.java) there are some diferences, i.e the
>>> constructor its missing, I don't have any issue in putting just
>>> super();, but Im wondering if I will have some p[roblems in the
>>> future...
>>
>>
>> Veogen templates do the right thing. Don't worry about the missing
>> constructor, do not added it, you will (and should) never call it
>> directly.
>>
>> When creating a new DisplayBoard you'll see in the code for the
>> tutorial that Janine uses:
>>
>> DisplayBoard displayBoard =
>> (DisplayBoard)EOUtilities.createAndInsertInstance(session
>> ().defaultEditingContext(), "DisplayBoard");
>>
>> This is such a common line of code that the Veogen templates
>> generate factories that do that for you.
>>
>> So you can call:
>>
>> DisplayBoard displayBoard =
>> DisplayBoard.newDisplayBoard(session().defaultEditingContext());
>
>
> I guess I should have put in a reference to the canonical EOF
> Commandments:
>
> <http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-The+EOF+Commandments
> >
>
> ;david
>
> --
> David LeBer
> Codeferous Software
> 'co-def-er-ous' adj. Literally 'code-bearing'
> site: http://codeferous.com
> blog: http://davidleber.net
> profile: http://www.linkedin.com/in/davidleber
> --
> Toronto Area Cocoa / WebObjects developers group:
> http://tacow.org
>
>
This archive was generated by hypermail 2.0.0 : Wed Mar 12 2008 - 17:42:54 EDT