32
votes
Accepted
Is it OK to use the same field in the database to store both a percentage rate and a fixed money fee?
Your analysis is correct.
Beyond the complexity issue I would add as problems:
The design is misleading and error-prone as it could give the impression of handling in a uniform way the fee field.
It ...
23
votes
When is primitive obsession not a code smell?
Primitive Obsession is using primitive data types to represent domain ideas.
The opposite would be "domain modeling", or perhaps "over engineering".
Would you create a ...
17
votes
Is it OK to use the same field in the database to store both a percentage rate and a fixed money fee?
There's a much simpler approach here that should bypass any petty database schema design arguments. Your business logic is really this:
TOTAL_COST = (BASE_COST * (1 + PERCENT_FEE)) + FLAT_FEE
...
16
votes
Accepted
How to model public IDs?
You cannot look into the future - accept that. So better go ahead with a simple, but sufficient solution for today, and add more complexity when you know the requirements, not beforehand.
If you ...
14
votes
What is a proper diagram to describe software architecture
What is the purpose of the layers ?
The clean architecture aims to achieve separation of concerns, by dividing the software into concentric layers.
The main difference compared to the traditional ...
13
votes
When is primitive obsession not a code smell?
A possible rule of thumb may depend on the program's layer. For the Domain (DDD) aka Entities Layer (Martin, 2018), this might as well be "to avoid primitives for anything representing a domain/...
12
votes
How do I manage shared models among many microservices?
The other answers are correct as far as the coupling being at the data interface level. But they don't really answer the question posed in the title:
How do I manage shared models among many ...
12
votes
Does the signature of a method create a dependency between the implementation of that method, and the code that invokes it?
To give your question more context, let us remember what Ousterhood is trying to explain in the section of the book. Let me cite the first sentence from the paragraph where you got your cite from:
...
11
votes
Accepted
How much UML modeling should you do?
UML covers indeed a very large set of modelling needs, from the most elementary designs, to almost visual coding, especially if considering neighbour standards such as OCL. If all these things were ...
11
votes
Is it OK to use the same field in the database to store both a percentage rate and a fixed money fee?
This might be overkill for your needs here, but another option that you might not have considered is to separate these values into two separate child tables e.g. PERECENT_FEE and FIXED_FEE which have ...
10
votes
Accepted
What is the benefit of encapsulating a collection inside a class?
The problem with your original code example, is that Orders breaks the encapsulation of _orders as you are returning the list. Cast that IEnumerable<Order> to IList<Order> and code outside ...
10
votes
UML: what is the correct order of steps?
UML is just a language to draw pretty pictures with some chance that others understand what the shapes mean without an extensive explanation from you.
UML does not tell you which diagrams to use in ...
9
votes
When is primitive obsession not a code smell?
To be honest: it depends.
There is always the risk of overengineering your code. How widespread will DateOfBirth and Salary be used? Will you only use them in three tightly coupled classes, or will ...
9
votes
How to model public IDs?
You're right; the membership ID is not part of your Primary Key. That's why synthetic keys exist.
A synthetic key is one that is automatically generated, either by you or the database. It usually ...
9
votes
Before OOP, how were systems modeled
It would be pretty silly to think that we didn't have objects before OOP.
OOP formalizes a notion of class, which allows arguably superior code organization. But these same constructs can be ...
9
votes
Accepted
Data Modeling: Are technical concepts within a tool that implement a business entity entities as well?
Your original question gave the impression you were trying to model entities without knowing how they will be used. That's a classic road to hell, paved with good intentions.
Data modeling requires ...
8
votes
When is primitive obsession not a code smell?
Better suffer from Primitive Obsession or being an Architecture Astronaut?
Both cases are pathological, in one case you have too few abstractions, leading to repetition and easily mistaking an apple ...
8
votes
Accepted
Navigation in Class Diagram
Navigability means according to the UML specifications:
that instances participating in links at runtime (instances of an
Association) can be accessed efficiently from instances at the other
...
7
votes
What is a proper diagram to describe software architecture
Consider Simon Brown's C4 model. In summary (from Wikipedia),
Context diagrams (level 1): they show the system in scope and its relationship with users and other systems;
Container diagrams (level ...
7
votes
Accepted
How do you correctly turn this text into an activity diagram (problem with timer)?
Problem
Your diagram has several flaws. For instance, you'd need a join to synchronize the camera recording and the timer. But then, the semantic would mean that both activities must be finished ...
7
votes
Accepted
How to design correctly relationships of class diagrams?
This is fine for a start, but you're pretty data-heavy.
Object-orientation is about cooperation among objects, with each bringing its own specific knowledge and behavior to contribute to the whole. At ...
7
votes
Should I model constraints which are valid, but which have no current function in the domain?
In the past, I have experienced both kinds of situations:
cases where a system contained things like constraints which were surely added in good faith, but were never really needed - and later turned ...
6
votes
Accepted
Use Case Diagram: Too many <<include>> relationships
Is it about the use case diagram ?
Use case shall give the big picture of the system under consideration, by showing what it is used for and how it brings value to the actors in its environment.
The &...
6
votes
Before OOP, how were systems modeled
OOP is actually more limited as far as modeling is concerned. The reason is every verb must be tightly coupled to exactly one noun. Other paradigms don't have that limitation. You don't have to make ...
6
votes
Before OOP, how were systems modeled
Before OOP, the structured programming paradigm used to separate processes and data.
This separation also applied for modelling:
Processes used to be modelled with dataflow diagrams (the most ...
6
votes
UML: what is the correct order of steps?
Bart van Ingen Schenau's answer is right in that UML is just a language and not a methodology. However, there are some methodologies that are built around tools (including UML), such as the Rational ...
6
votes
Accepted
When modeling requirements, how can I depict class diagram attributes whose allowed values are custom defined and in finite number?
This problem can be solved in two ways: either by using the enumeration concept from the UML 2 standard, or by doing the simplest thing that works.
Enumerations in UML 2
(based on the UML 2.5.1 ...
6
votes
Accepted
Associations and References in UML Class Diagram
So long as the reference isn't to a basic data type, not only is it possible, it's common practice.
Redundantly showing both is also possible. But I've never seen a rule requiring it.
It's also common ...
5
votes
Advice on AggregateRoot boundaries
There are two different aspects in your question: where should the boundary be in your domain model? and how to implement your model?
The boundaries in the model
The definition of an aggregate is:
A ...
5
votes
Base class responsibility
Is it OK to have a base class with protected methods that deal with
both activities and products, and have all 3 classes inherit from this
base class?
No that would be bad(tm).
Use interfaces and ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
modeling × 246uml × 80
design × 44
diagrams × 25
domain-driven-design × 24
domain-model × 19
object-oriented × 18
object-oriented-design × 18
database-design × 17
architecture × 16
use-case × 14
class-diagram × 14
activity × 10
design-patterns × 9
model × 9
data-modeling × 9
systems-analysis × 9
bpmn × 9
sequence-diagram × 8
requirements × 7
c# × 6
database × 6
functional-programming × 6
python × 5
data × 5