I have a class which is an aggregate root and represents a Person. A person must have a Title ( Mr, Mrs, Ms etc ) which is a property of the Person object. When creating a person the user must select a title from a drop down list the contents of which are administered via another page.
There is also the option to view this information via a read-only page so by using the model below I have the Id and Name "to hand" and do not have to go away and retrieve the ValueName of the title based on the title id which is what I would have to do if I were to add TitleId as a property of Person rather than Title.
When saving a person object the Id of the title is persisted as part of the person and is stored in the Person db table (the db table containing the titles is not touched)
When populating person the stored procedure joins person on to title based on title id and returns information used to populate the person an title classes.
public class Person : IAggregateRoot, IPerson
{
public string Forename { get;set; }
public string Surname{ get;set; }
public ITitle Title { get;set; }
}
public class Title : IAggregateRoot , ITitle
{
public Guid Id {get;set;}
public string ValueName {get;set;}
}
My question is: From a DDD perspective is it ok to use this class structure and have an aggregate root object nested within another aggregate root object given that it is a "fixed list" or "lookup value" and also needs to be maintained separately by an administrator?