Community
Participate
Working Groups
Currently it is tedious to replace scout model objects configured in super classes by sub classes. Just extending the super class does not replace its instance (but inherits all its properties). While this is desired in rare situations, it is more common to replace overridden classes by their subclasses. A new annotation @Replace should control and simplify the process of replacement: o Subclasses without the @Replace annotation are simply added as additional instance o Subclasses with the @Replace annotation replace the direct super class o Subclasses with the @Replace(value=Foo.class) annotation replace the first class found, that is assignable to the given class. Example: Current style public class MyTable extends AbstractTable { public class MyColumn extends AbstractStringColumn { } } public class MyTableEx extends MyTable { @Override protected void injectColumnsInternal(List<IColumn<?>> columnList) { ExtensionClientUtility.removeByType(columnList, MyColumn.class); } public class MyColumnEx extends MyColumn { } } Using the new @Replace annotation public class MyTable extends AbstractExtensibleTable { public class MyColumn extends AbstractStringColumn { } } public class MyTableEx extends MyTable { @Replace public class MyColumnEx extends MyColumn { } }
added annotation as suggested to scout client extension layer. committed on scout trunk (3.9.0)
Bug closed, shipped with 3.9.0 (Kepler)