Reason for *Base (e.g. PropertiesBase, HelperBase) classes

26 views
Skip to first unread message

Ron Smith

unread,
Jun 18, 2014, 10:34:55 PM6/18/14
to sculptor...@googlegroups.com
I need to override some methods that are defined in the *Base classes (e.g. PropertiesBase, HelperBase).

Unfortunately, I can't because they're implemented in Java and don't support the Sculptor extension mechanism.

Do you know what the reason is these are implemented in Java?  Was it a historical optimization when Helper, Properties, etc were in XTend1?

Unless there's a reason they have to stay in Java, I'd like to start migrating these methods to the corresponding Helper, Properties, etc XTend2 classes.

--Ron

Torsten Juergeleit

unread,
Jun 22, 2014, 1:39:45 PM6/22/14
to sculptor...@googlegroups.com
These util/*Base relicts from the Xtend1 times bothered me a few times as well. Some methods in util/*Base are redundant to the ext/* ones, e.g. "boolean getBooleanProperty(String propertyName)".
I don't know the historical reasons but with Xtext2/Xtend2 this Java/Xtend1 hybrid approach doesn't make sense to me anymore.

So go ahead refactoring the util/*Base stuff. But keep in mind that some methods are using the same method name but have a different implementation or have additional parameters, e.g. "def getProperty(String propertyName, String defaultValue)". So we have to make sure that the templates are picking up the proper methods. Maybe we need additional tests.

/Torsten
Reply all
Reply to author
Forward
0 new messages