Models
Classes
Here is the code for the Party class which realizes the class diagram shown above:namespace Circles.DomainModel
{
using System;
using System.Collections.Generic;
/// <summary>
/// An abstract class representing any 'Party' that can be interacted with.
/// </summary>
public abstract class Party
{
private ISet<ChannelAddress> channelAddresses = new HashSet<ChannelAddress>();
private ISet<PartyNote> notes = new HashSet<PartyNote>();
private ISet<PostalAddress> postalAddresses = new HashSet<PostalAddress>();
/// <summary>
/// Gets or sets the unique identifier of the Party instance.
/// </summary>
public Guid PartyId { get; set; }
/// <summary>
/// Gets or sets the name of the Party instance.
/// </summary>
public virtual string PartyName { get; set; }
/// <summary>
/// Gets or sets the PartyType of the Party instance.
/// </summary>
public virtual PartyType PartyType { get; set; }
/// <summary>
/// Gets or sets the Notes associated with the Party instance.
/// </summary>
public ISet<ChannelAddress> ChannelAddresses
{
get { return this.channelAddresses; }
set { this.channelAddresses = value; }
}
/// <summary>
/// Gets or sets the Notes associated with the Party instance.
/// </summary>
public ISet<PartyNote> Notes
{
get { return this.notes; }
set { this.notes = value; }
}
/// <summary>
/// Gets or sets the Notes associated with the Party instance.
/// </summary>
public ISet<PostalAddress> PostalAddresses
{
get { return this.postalAddresses; }
set { this.postalAddresses = value; }
}
}
}
Note that this is not the “finished product” but rather an early version along the way. Future articles will refine this further.
The source code for this article can be downloaded from here.
Next we’ll look at persistence of this model.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.