303 karma · joined June 30, 2015
> Here's an example why such an approach inevitably must fail: if the business says that orders can only be made until 10000 items have been ordered in a month, then you cannot model that constraint inside of the order class. You must move it outside - to the entity that knows about all the orders in the system. That would be the OrderRepository or however you want to call it.
It's not that hard.
If the constraint of your example is a domain constraint, and so it's *always* valid, then when you hydrate an Order entity, other than the Order data itself, you also need to provide the total number of orders.
```
// orders is the repository, and it hydrates the entity with the total number of orders for this month
order = orders.new()
// Apply the check
order.canBeCreated()
```
Where the `canBeCreated` method is as simple as:
```
if this.ordersInAMonth > TOTAL_NUMBER_OF_ORDER_IN_A_MONTH ...
```
Fixed.
It's the same as using the OrdersRepository to query the number of orders directly before creating one, but here, the logic is just in the class.
Now, your example is pretty stupid, so I know it must not be taken literally but...
PS: I'm all but not a DDD advocate.
For example?
Companies that relies on heroes and constant firefighting to keep running are doing it wrong. Very wrong.
Bah. I wouldn't say I like this approach, since it's based on the assumption (wrong in my opinion) that using a tool or a set of rules to enforce social communication, will solve the socialization problem.
Do you want to talk about a book? Talk about it.
Would you like to know your new remote colleague? Book a call with her.
And so on, on a list of examples that I'd like to sum up in this sentence:
if you want to socialize, just socialize, since no tool can do that for you.
----
Then, I'm quite in line with this comment from @nmat
> Face-to-face communication is very underrated nowadays, probably because of the negative connotations associated with meetings. Talking to someone is by far the fastest way to convey information. I often prefer a quick chat to spend 30 minutes writing Slack messages back and forth. I agree that writing has other benefits and it's better in certain cases but we need to get out of the mindset that writing/async is always better.
A direct, face-to-face conversation is usually way faster than a ping-pong chat on Slack or, worse, especially for day-to-day activities.
On the same line of thinking, instead of long, useless meetings, or writing pedantic, bureaucratic, asynchronous long forms (like the 30 bullet points of the article), I'm a big proponent of pair/mob activities within small teams:
Use a visual collaboration tool, a shared document, or a code editor, and write together!
Utilize a timer and change the driver often.
Keep people focused and work together.
I've never seen teams be as efficient and fast as the ones adopting this approach.
Finally, the principle that I like most of the Agile Manifesto, the most important one to me:
> Individuals and interactions over processes and tools
I would argue that is the opposite: it's fair to say that the interview is a cheat.
And I can't understand sorry, why should we go back to this scenario, exactly?
I've been in jail for a robbery when I was young, and I genuinely wanted to know the experience of the person who wrotes the comment.
Yes but...what is the shape of those messages? I ways prefer to know the type of the material I'm working with...
My experience is completely the opposite. PMs that don't understand the how, that is, they don't know how their product works, are the worst.
Best PMs that I worked with had a technical background.
Ps: Nathan James, pls stop
Hi! I’m an experienced Software Engineer from Italy, with a long experience in designing, implementing, and releasing successful web applications.
I worked across a wide range of business domains, including small companies, well-known enterprise corporations, and startups, driving cross-functional teams to adopt best practices, optimize performances, and deliver innovative solutions that meet both user and business needs.
Passionate about:
- Domain Modelling - DevOps culture - Test-Driven Development (TDD), Extreme Programming - Node.JS, Typescript, and Web technologies
I’m also a creative guy, and during my free time, I like painting graffiti and canvases , drawing , and taking pictures with my camera .
I work 4 days per week because I believe in a strong life/work balance.
And please, after 20+ years of DDD at least, give Evans some credit: name your things after your business domain...!
The networking part was always and always will be relagated to the infrastructure. Really not sold to the all "serverless" fiasco.