What I’d be asking myself, is roughly…
How many of these methods are public (or couldn’t be made more restrictive based on who calls them)?
Do all of your projects deal with roughly the same public methods or are there distinct groups of methods for differing projects?
How many of these methods are short helpers to other methods?
How many functions are there (either local within method bodies or freestanding)?
How many data fields are there in Route/RouteChange
?
Do all the methods work on pretty much all of Route/RouteChange
’s data fields, or do different clumps get worked on by groups of different methods?
How many instances of Route
do your various projects work with - multiple (presumably), or just one?
Do some of the data fields only have validity for short durations while certain methods execute, but not over the entire lifespan of the Route
instance?
Do some of the methods concern themselves much more with the argument and result data than the data fields of Route/RouteChange
?
Could a Route
compose a RouteChange
internally, or just instantiate route changes on the fly? It sounds to me like a route change is a transient thing that happens zero or many times for a given route. Perhaps a route change should take one route and yield another?
Are most if not all of the data fields in Route/RouteChange
immutable? If so, could they passed as implicit context to functions that need them? (Or use Reader
if you’re a fan of monadic code).
How many other classes or freestanding functions does a route instance interact with, or rely on in its implementation? I mean, other than the standard library things.
I’m reciting the standard OOP 101 here, forgive me if this is pitched at the wrong level, but I can’t help but feel that something is awry here in the design. Of course, working software is precisely that, design notwithstanding, but again, I’d urge you to consider a breakdown by classes and composition / delegation, functions, type classes or whatever.
That’s as much as I can usefully offer, so I’ll bow out of this thread and leave you to the tender mercies of the other participants. Happy hacking…