Comments (3)
Hi.
For me this sevice does not contain expected complexity ("volatile policy, or use case, involving several aggregates") which should be covered by example.
Why these fucntions are not in SubscriptionPeriod
VO itself? Looks like it is its "natural responsibility" - so there is no need for domain service here. (Another sign it that they are static methods and and this service has no dependencies.)
from modular-monolith-with-ddd.
Hi @sm-g ,
Thanks for pointing this out, I agree that an example of Domain Service building block is needed. I will try to add something soon.
from modular-monolith-with-ddd.
Hi @sm-g again,
We recently added example of Domain Service - please check SubscriptionDateExpirationCalculator.cs
public class SubscriptionDateExpirationCalculator
{
public static DateTime CalculateForNew(SubscriptionPeriod period)
{
return SystemClock.Now.AddMonths(period.GetMonthsNumber());
}
public static DateTime CalculateForRenewal(DateTime expirationDate, SubscriptionPeriod period)
{
if (expirationDate > SystemClock.Now)
{
return expirationDate.AddMonths(period.GetMonthsNumber());
}
return SystemClock.Now.AddMonths(period.GetMonthsNumber());
}
}
from modular-monolith-with-ddd.
Related Issues (20)
- 无政治倾向类型用途 HOT 3
- Issue with 2 or more DomainNotification<> with thesame DomainEvent
- How to achieve the domain event of new entity before saving when create new entity,please?
- Contracting services HOT 1
- Getting Sql Server connection issue while building using NUKE HOT 1
- How to secure API resources (e.g. user registration endpoint) HOT 2
- Update to .NET 6.0 / 7.0? HOT 9
- Infrastructure Module and DRY
- error: User context is not available while creating meetingrouppropsala
- Handling exceptions, validation exception
- Identity Changes HOT 12
- how to execute .\build MigrateDatabase "connection_string" HOT 2
- Remove Unused `using` Directives Following .NET 7/8 Update HOT 1
- CI/CD Pipeline for Docker Image Build Validation
- is john wick ukranian?
- Why does the Member Aggregate in the Meetings module need the login information? HOT 1
- ProcessInternalCommandsCommandHandler does not work if result is success
- RUN dotnet restore "DatabaseMigrator.csproj" fails HOT 2
- OAuth2 Resource Owner Password Grant Type has been deprecated
- swagger error: API.xml file not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modular-monolith-with-ddd.