Skip to content

Conversation

@grimsa
Copy link
Owner

@grimsa grimsa commented Jul 14, 2022

Changes are based on this suggestion

…bject creation into a separate branch in the package hierarchy
Comment on lines +13 to +19
private final BiFunction<RoofFace, PvModuleDefinition, LayoutSpecification> layoutSpecificationConstructor;

public DefaultPvModuleLayouts(
BiFunction<RoofFace, PvModuleDefinition, LayoutSpecification> layoutSpecificationConstructor
) {
this.layoutSpecificationConstructor = layoutSpecificationConstructor;
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

If the constructor required more parameters, we'd probably have to introduce something like this

interface LayoutSpecificationConstructor {
    LayoutSpecification construct(
        RoofFace roofFace,
        PvModuleDefinition pvModuleDefinition,
        Object someOtherArg1,
        Object someOtherArg2
     );
}

probably as a nested interface inside LayoutSpecification

Comment on lines +1 to +13
package com.company.appconfig;

import com.company.app.PvModuleLayouts;
import com.company.app.pvmodulelayouts.DefaultPvModuleLayouts;
import com.company.app.pvmodulelayouts.layoutspecification.RoofSlopeDependentLayoutSpecification;

// @Configuration
public class Main {
// @Bean
public PvModuleLayouts pvModuleLayouts() {
return new DefaultPvModuleLayouts(RoofSlopeDependentLayoutSpecification::new);
}
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This code that would plug everything together goes into a parallel package hierarchy

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.

2 participants