Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object counts per condition context #199

Merged
merged 17 commits into from
Nov 17, 2016

Conversation

arunverma87
Copy link
Contributor

@arunverma87 arunverma87 commented Oct 12, 2016

related to issue #174

Copy link
Member

@stempler stempler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is getting more complex than the initial implementation, maybe it makes sense to add respective unit tests. What do you think?
That would provide the opportunity to target edge cases specifically and verify that they work. Do you think it would be much effort creating tests?

.getChildren(groupDef);
if (children != null && children.iterator().hasNext()) {
for (EntityDefinition def : children) {
if (groupDef instanceof TypeEntityDefinition)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this ever happen?

increase(groupDef, 1);
}
else {
ChildContext context = path.get(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't here always the last path element relevant? Because that should be the path element that the child has in addition to its parent. The parent is on the instance side represented by the group.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I am starting to see that you changed the way that addToPopulation works by specifying what you want to limit the count to, via the provided EntityDefinition. It would be good if you would reflect that in the method documentation. "the group entity definition" does not tell anything - my first assumption was that it is directly related to the group.


for (Object value : values) {
if (value instanceof Group) {
addToPopulation((Group) value, propertyDef);
addToPopulation((Group) value, groupDef, subPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you pass all Group values on, but shouldn't that be done only for those that were counted for this level?
For instance: If it did not match the condition at this level, it should not be counted on the next.

Bundle-Version: 3.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: wetransform GmbH
Import-Package: eu.esdihumboldt.hale.common.align.model,
Copy link
Member

@stempler stempler Nov 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By convention these projects/bundles should rather be placed in common instead of ui and named accordingly, as they don't have any UI dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought as it contains helper class for ui service so named with UI. I'll change according to your suggestion.

@stempler stempler merged commit 180b5ff into halestudio:master Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants