Programmery Question
Posted: Thu Jul 31, 2014 6:06 pm
The constant struggle in our organization is the fact that Department of Justice constantly changes business rules and even what the business objects end up being.
After 11 years here, I've found that when I'm modeling a domain, I almost never code definite types for my business objects - I've been so accustomed to the constant redefinition that rather than modeling things at the level like having a class called "Assault" which inherits/implements "Offense" I just have a class called Offense which loads all of the necessary values from the database so that the records personnel can keep the system up to date with whatever lawmakers and the California and US Departments of Justice want to throw at us without me having to really modify any code. Some of this is also carryover from the legacy, COBOL system where things were just passed through byte arrays anyway.
However, I feel like this has leaked into ALL of my coding. As an example, I'm working on a side project for a friend that will allow him to manage membership status for his bar in Portland - basically if the customer drinks rums from this list, he gets promoted to some frequent drinker status, and that status can increase.
Anyway, the other day I was building my models and realized I had gone with the same dynamic approach. There is no "rum" - there's a spirit. There is no Bacardi 1909, there's a product. Granted, the products will be far more dynamic, so it makes sense to keep them data-driven, but spirit categories like Rum, Tequila, Whiskey, etc. aren't likely to change - so am I taking the wrong tack with that?
Thoughts? Jimer/Gando/Bulwark/OtherPeopleI'mNotMentioningThatKnowCoding?
Should there be a Product with a field of Spirit where the Spirit class just has fields of Name and maybe Description, or should it be that there's a Spirit base-class that Rum inherits from that can be in that field? Or am I just overthinking this and bothering you?
After 11 years here, I've found that when I'm modeling a domain, I almost never code definite types for my business objects - I've been so accustomed to the constant redefinition that rather than modeling things at the level like having a class called "Assault" which inherits/implements "Offense" I just have a class called Offense which loads all of the necessary values from the database so that the records personnel can keep the system up to date with whatever lawmakers and the California and US Departments of Justice want to throw at us without me having to really modify any code. Some of this is also carryover from the legacy, COBOL system where things were just passed through byte arrays anyway.
However, I feel like this has leaked into ALL of my coding. As an example, I'm working on a side project for a friend that will allow him to manage membership status for his bar in Portland - basically if the customer drinks rums from this list, he gets promoted to some frequent drinker status, and that status can increase.
Anyway, the other day I was building my models and realized I had gone with the same dynamic approach. There is no "rum" - there's a spirit. There is no Bacardi 1909, there's a product. Granted, the products will be far more dynamic, so it makes sense to keep them data-driven, but spirit categories like Rum, Tequila, Whiskey, etc. aren't likely to change - so am I taking the wrong tack with that?
Thoughts? Jimer/Gando/Bulwark/OtherPeopleI'mNotMentioningThatKnowCoding?
Should there be a Product with a field of Spirit where the Spirit class just has fields of Name and maybe Description, or should it be that there's a Spirit base-class that Rum inherits from that can be in that field? Or am I just overthinking this and bothering you?