Skip to main content
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 ...
Christophe's user avatar
  • 82.2k
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 ...
VoiceOfUnreason's user avatar
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 ...
mymarkers's user avatar
  • 287
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 ...
Doc Brown's user avatar
  • 220k
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 ...
Christophe's user avatar
  • 82.2k
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/...
schrödingcöder's user avatar
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 ...
Kyle McVay's user avatar
  • 1,986
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: ...
Doc Brown's user avatar
  • 220k
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 ...
Christophe's user avatar
  • 82.2k
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 ...
JimmyJames's user avatar
  • 30.9k
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 ...
David Arno's user avatar
  • 39.6k
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 ...
Bart van Ingen Schenau's user avatar
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 ...
CharonX's user avatar
  • 1,740
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 ...
Robert Harvey's user avatar
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 ...
Erik Eidt's user avatar
  • 34.8k
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 ...
Doc Brown's user avatar
  • 220k
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 ...
Deduplicator's user avatar
  • 9,309
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 ...
Christophe's user avatar
  • 82.2k
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 ...
ximiki's user avatar
  • 405
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 ...
Christophe's user avatar
  • 82.2k
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 ...
Robert Bräutigam's user avatar
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 ...
Doc Brown's user avatar
  • 220k
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 &...
Christophe's user avatar
  • 82.2k
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 ...
Karl Bielefeldt's user avatar
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 ...
Christophe's user avatar
  • 82.2k
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 ...
Thomas Owens's user avatar
  • 85.9k
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 ...
amon's user avatar
  • 136k
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 ...
candied_orange's user avatar
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 ...
Christophe's user avatar
  • 82.2k
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 ...
Ewan's user avatar
  • 84.4k

Only top scored, non community-wiki answers of a minimum length are eligible