Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Wish List
-
Component/s: Eclipse integration
-
Labels:None
-
Number of attachments :
Description
When running a incremental build in Eclipse, you can easily run into compile problems in the generated code. For instance if you have modeled the following domain class and dto class
class Product [
string productNumber;
decimal price;
]
class FullProductDto represents Product
The following code is generated into generated-sources folder of the service module:
../generated-sources/org/company/recordshop.service.dto.translators
public class FullProductDtoTranslator { ... if (target == null) { if (source.getId() != null) { throw new TranslatorException( "Can not translate a dto with existng id to a new domain object."); } target = new Product(source.getProductNumnber(), source.getPrice()); } ...
Problem:
When you remove or rename a attribute element from the Product class in the model-file and save it, an incremental build will be executed by the Mod4jBuilder. This will regenerate sources into the domain and data layers, but not for the dependent sources in the service layer. Resulting into compile errors at the last code-line in the code example above. The constructor of Product was changed.
Workaround: Perform a full build (Project > Clean).
Solution:
The Mod4jBuilder should be able to perform incremental cascading builds. Meaning that if a model-file is changed, all other model-files that uses references to classes from that model-file, should participate in the build.
BusinessDomain model A used-by> DataContract model H used-by> Service model X
used-by> DataContract model I used-by> Service model Y
BusinessDomain model B used-by> DataContract model J
If BusinessDomain model A changes, also DataContract models H and I must participate in the build.
If DataContract model H changes, also Service model X must participate in the build.