prefixes for class names

11 views
Skip to first unread message

Jan Polowinski

unread,
Nov 5, 2013, 3:21:07 PM11/5/13
to semw...@googlegroups.com
Hi all,

I'm looking for a way to prefix class names. The wiki suggests that "The prefix String can be set to e.g. "gen_" to let all generated classes have that prefix." But thi is a bit misleading, since this will only prefix method names. We are sub-classing the generated classes and modify these sub-classes only (as suggested in the documentation) to allow for regenerating code without loosing our modifications. Here it would be helpful to prefix the classes - not methods - to easily distinguish generated and manually created classes. (Of course, as a workaround we could prefix the manually created (sub-)classes, but I would prefer to prefix the generated ones. I think the way to got is to change the templates. Please stop me if there's a better way to go.

Jan

Roland Stühmer

unread,
Nov 5, 2013, 4:05:18 PM11/5/13
to semw...@googlegroups.com
Hi Jan, all!


Jan Polowinski wrote:
I'm looking for a way to prefix class names. The wiki suggests that "The prefix String can be set to e.g. "gen_" to let all generated classes have that prefix." But thi is a bit misleading, since this will only prefix method names.

Can you point me to this documentation, I will clarify it.
 
We are sub-classing the generated classes and modify these sub-classes only (as suggested in the documentation) to allow for regenerating code without loosing our modifications. Here it would be helpful to prefix the classes - not methods - to easily distinguish generated and manually created classes. (Of course, as a workaround we could prefix the manually created (sub-)classes, but I would prefer to prefix the generated ones. I think the way to got is to change the templates. Please stop me if there's a better way to go.

You are right, the templates are the way to get what you need. The method prefix variable "methodnameprefix" would need another variable like "classnameprefix".

However, how about just generating the classes in another package (separating them from the manually created classes), by giving a different packge name to the generator?

Best!

Roland.

Reply all
Reply to author
Forward
0 new messages