cvokk
unread,Apr 6, 2008, 5:53:26 AM4/6/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Php Object Generator
Good day.
At first I want to thank you again for a great work you did with POG
so far, I had really good time using the objects.
I would like to propose you, however, two little hints for your code
generation strategy, which could be a lot helpful.
----------------------------------------------
1) when generating comments for GetParent() method, currently the
coment is generated in a following way:
/**
* Associates the User object to this one
* @return boolean
*/
function GetUser()
{
Would it be possible for you to change the generated comment to the
following
/**
* Associates the User object to this one
* @return User
*/
function GetUser()
{
instead of "boolean" put there the class name. It would make a great
help for people using Eclipse or other editors, which respect those
comments. Then, when you would do
$obj = new SomeObject();
$obj->GetUser()-> <----- in this part, when there is @return User
comment, the IDE would offer you methods and fields of the User class,
which I think is nice improvement.
Now what I do is manually edit the class files when I need this
functionality, would it be any problem if you change it in the
generator?
----------------------------------------------
2) it would be nice, if POG_Base would implement some common
interface, say PogObject, which would define
Get, GetList, Save, SaveNew, Delete, DeleteList methods.
The point is, that you could than in PHP force the method parameter to
be of this interface type, e.g.
class UtilClass{
public method someMethod(PogObject $obj){
// here in this method you could again do
$obj-> <------- and again, here IDE would offer you one of the
defined methods in the interface
}
}
What I do now is
public method someMethod(POG_Base $obj){
}
to at least be sure, that $obj is POG object instance, but interface
would be much nicer.
What do you think about all that?
Wish you a nice day.
Kind regards Vitek