-
Notifications
You must be signed in to change notification settings - Fork 0
Model element naming conventions
I cannot overstate the value of strict adhererence to a naming convention, especially when it comes to managing large model sets.
This isn't just about making the models pretty or satisfying an obession for neatness.
It's about getting your models up and running as soon as possible and not having to waste half a day chasing down a minor mis-naming bug, that, for the life of you, you just don't see.
There are a lot of other good reasons, but having just encountered an incident like this, I am motivated to write the conventions I use.
Let's say that during execution, your models keep breaking for some reason. And it turns out its because of a subtle typo in a name or a name in the wrong place. If you follow naming conventions you are much more likely to notice the type name where an attribute name should have been because you saw the initial caps in each of the name's words and knew that couldn't be right!
This kind of thing happens all the time and I am always grateful when my naming conventions help me recognize an error on the spot.
Here I describe the naming conventions that I use, some of which are enforced by the scrall parser.
Feel free to invent your own and fork the parser accordingly. But if you would rather devote your valuable getting systems built, I recommend just adopting my somewhat arbirary, yet consistent, choices for naming model elements.
Initial capital for each word
Accessible Shaft Level
Initial cap first word only
Destination floor
Wait states exit when an Interaction Event occurs while transitory states exit on a self generated Completion Event.
All letters in capitals
STOPPED AT FLOOR
First word in initial caps (question mark at end of name allowed)
Requests pending?
All words lower case
next dest
First word in initial caps
Goto floor
Each word has initial cap
Level Name
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration