[CSHARP-3868] Using internal constructor of any ValueObject par of an aggregate is not possible ? Created: 20/Sep/21 Updated: 27/Oct/23 Resolved: 12/Oct/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Nicolas REY | Assignee: | Dmitry Lukyanov (Inactive) |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | DDD, constructor, serialization | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Hi, I would like to work with Domain Driven Design Tactical patterns, using MongoDb as the storage engine of my aggregates. To ensure object encapsulation I need to provide internal scoped constructor (for internal object creation in my Domain layer), and public factories for extra domain layer object creation.
Example : Aggregate
Value Object
|
| Comments |
| Comment by PM Bot [ 12/Oct/21 ] | |||||||||||||||||||
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. | |||||||||||||||||||
| Comment by Nicolas REY [ 22/Sep/21 ] | |||||||||||||||||||
|
Hi ! Thank you for your feedback, I'll give it a try | |||||||||||||||||||
| Comment by Dmitry Lukyanov (Inactive) [ 20/Sep/21 ] | |||||||||||||||||||
|
We don't support internal ctor since from mongo driver point of view, it's the same as private one. And we still need to instantiate it.
| |||||||||||||||||||
| Comment by Nicolas REY [ 20/Sep/21 ] | |||||||||||||||||||
|
Well I missed the end of the message, can't find how to edit it ... :
Then on persisting my object, the Information VO is set to an empty object in MongoDb. When I use a public constructor for my nformation VO instead of the object persisted is correct (with it's value)
Any possibility to use an internal constructor their ? Thank you |