'Naming: Composite vs compound for entities that delegate function calls to array of entities (vs something else?)

Imagine you have some Entity class and want another class that groups multiple instances of Entity.

How do you name it?

  • CompoundEntity?
  • CompositeEntity?
  • something else?

This is a common thing I do, and my colleagues use different naming convention. I have no idea what is better and also I'm not a native English speaker.

Concrete example:

public final class CompoundSetUpAction: SetUpAction {
    private let setUpActions: [SetUpAction]
    
    public init(
        setUpActions: [SetUpAction])
    {
        self.setUpActions = setUpActions
    }
    
    public func setUp() -> TearDownAction {
        return CompoundTearDownAction(
            tearDownActions: Array(setUpActions.map { $0.setUp() }.reversed())
        )
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source