Model Train-related Notes Blog -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting. I also have more posts in a blog dedicated to the maintenance of the Randall Museum Model Railroad.

2023-03-31 - Conductor 2 DSL: ActiveRoute

Category Rtac

One thing I still don’t like in the Conductor 2 DSL is the name of the “ActiveRoute” object.

It’s misleading and confusing.

As a reminder, in the current DSL:

  • An “active route” is a list of routes, of which only one is active at a single time.
  • A route is a sequence of nodes, each node corresponding to one block in a given direction.

It’s fairly misleading as one may think that an “active route” is one route that has become active, when it is actually a container of routes combined with a switch selector.

Possible name alternatives:

  • Routes
  • RoutesGroup
  • RoutesList
  • RoutesCollection
  • RoutesContainer
  • RoutesSelector

What all these names have in common is that we first pluralize “routes” to make it clear this is a container of one or more routes.

Routes “selector” is misleading as the object is a mere passive container, whereas a “selector” is performing an action.

Routes Container, List or Group seem redundant with just “Routes”.

However the problem with naming this just “Routes” is that it again creates confusion -- are we talking about the container object, or a different list of these route objects?

For that, we’ll take a hint from the Gradle DSL: “The DSL routes{} keyword creates a RoutesContainer. A RoutesContainer contains one or more routes, of which only one is active at the same time.”


 Generated on 2024-11-21 by Rig4j 0.1-Exp-f2c0035