value-objects

Shouldn't in the following model an Address be a Value Object?

妖精的绣舞 提交于 2019-12-12 00:53:47
问题 From How are Value Objects stored in the database? : Assume that a Company and Person both have the same mail Address. Which of these statements do consider valid? 1."If I modify Company.Address, I want Person.Address to automatically get those changes" 2."If I modify Company.Address, it must not affect Person.Address" If 1 is true, Address should be an Entity If 2 is true, Address should be a Value Object. Shouldn't in the above model the mail Address be a Value Object , since even if

Value Object as Invalid Object in asp.net core 2.1

谁都会走 提交于 2019-12-11 03:49:26
问题 I have been using value object in asp.net core 2.0 project, which was running properly on that project. I updated the project to 2.1 and it is giving me an error as Invalid object name 'EntityAdress'. Entity: public class Company : AuditableEntity<long> { public int SalesRepId { get; set; } public string Name { get; set; } public int StatusId { get; set; } public EntityAdress Addresses { get; set; } public string BillingAddress { get; set; } } public class EntityAdress : ValueObject { private

Generating ActionScript value objects from an xsd schema

妖精的绣舞 提交于 2019-12-11 01:15:33
问题 Are there any tools available for transforming types defined in an xsd schema (may or may not include other xsd files) into ActionScript value objects? I've been googling this for a while but can't seem to find any tools and I'm pondering wether writing such a tool would save us more time right now than to simply code our value objects by hand. Another possibility I've been considering is using a tool such as XMLBeans to transform the types defined by the schema to Java classes and then

Selection in Flex Datagrid does not pass the valueObject to selectionChangeHandler function

心已入冬 提交于 2019-12-10 12:10:59
问题 I have a TabNavigator, and each tab is a Module. One of the modules is labelled Units and the full code of the module is posted in this post. There are several problems: 1) Forms are not populated with data from the datagrid selection. 2) Selecting a row and clicking delete gives the very-common error: TypeError: Error #1009: Cannot access a property or method of a null object reference. A trace on the valueObject unit within the selectionChangeHandler function gives NULL. Why? Note: In other

Pending Updates Module - Domain Entity or Value Object?

此生再无相见时 提交于 2019-12-08 09:00:02
问题 I am in the process converting a large classic ASP web application to ASP.Net MVC with domain driven design. While much of my domain fits well with DDD, I keep running into situations where a pure DDD approach is not appropriate. For example the read side of my application varies significantly from the write side. No problem, I created a separate read model, and implemented a simplified version of CQRS (no event sourcing, no separate db). Another issue was bulk database operations. No problem

DDD: Share entity with multiple aggregate roots

孤人 提交于 2019-12-07 11:12:48
问题 Learning DDD, in our application there are three aggregate roots, different types of forms, all of which needs some PDF to be uploaded. These pdf uploads have some metadata, like who uploaded and when uploaded etc, attached to it so they are stored in their own table. My question is whether this PDF should be modeled as a value object or an entity or an aggregate root. For me it looks like an entity named as "Attachment" but then this entity should be shared, only the type not the instances,

DDD: Share entity with multiple aggregate roots

流过昼夜 提交于 2019-12-05 16:05:55
Learning DDD, in our application there are three aggregate roots, different types of forms, all of which needs some PDF to be uploaded. These pdf uploads have some metadata, like who uploaded and when uploaded etc, attached to it so they are stored in their own table. My question is whether this PDF should be modeled as a value object or an entity or an aggregate root. For me it looks like an entity named as "Attachment" but then this entity should be shared, only the type not the instances, by all the aggregate root. Is it an allowed practice to use same entity type in multiple roots, if so

EF 6: mapping complex type collection?

China☆狼群 提交于 2019-12-05 10:10:12
Does EF 6 (code first) supports complex type collection(Value Object collections) mappings? I know that it supports Complex types, but haven't still found an example where we have a collection of complex types. For instance, suppose you have an entity called Student, which has a collection of contacts. With NH, I can simply say that Student has a collection of contacts and that contact is a component (equivalent to complex type in ef). Can this be done with EF without changing contact to an entity? Apparently NHibernate is more flexible in that regard, because at the time of writing (EF6.2 and

Is it okay to expose the state of an Immutable object?

帅比萌擦擦* 提交于 2019-12-05 08:19:08
问题 Having come across the concept of immutable objects recently, I would like to know the best practices for controlling access to the state. Even though the object oriented part of my brain makes me want to cower in fear at the sight of public members, I see no technical issues with something like this: public class Foo { public final int x; public final int y; public Foo( int x, int y) { this.x = x; this.y = y; } } I would feel more comfortable declaring the fields as private and providing

Null value objects in NHibernate

三世轮回 提交于 2019-12-05 01:34:27
I have a person entity containing an Address as a value object: public Person() { WithTable("Person"); Id(x => x.Id); Component<Address>(x => x.Address, a => { a.Map(x => x.Address1); a.Map(x => x.Address2); a.Map(x => x.Address3); a.Map(x => x.Town); a.Map(x => x.Postcode); }); } It states in the NHibernate docs that if all the properties of a value object (Address1, Address2 etc) are null, the entire component will be mapped as null (i.e. Person.Address will be null). This is giving me problems in cases where all address fields are null because in my pages where I might have (I'm doing ASP