XMLMessageModel
using System;
using System.Collections.Generic;
using System.Text;
namespace Pattern.AbstractFactory
{
/**//// <summary>
/// XMLMessage實體類(Product)
/// </summary>
public class XMLMessageModel : AbstractMessageModel
{
/**//// <summary>
/// 構造函數
/// </summary>
public XMLMessageModel()
: base()
{
}
/**//// <summary>
/// 構造函數
/// </summary>
/// <param name="userId">UserId</param>
/// <param name="msg">Message內容</param>
/// <param name="pt">Message發布時間</param>
public XMLMessageModel(string userId, string msg, DateTime pt)
: base (msg, pt)
{
this._userId = userId;
}
private string _userId;
/**//// <summary>
/// Message內容
/// </summary>
public override string UserId
{
// 解密算法後的值
get { return _userId; }
// 加密算法後的值
set { _userId = value; }
}
}
}
AbstractMessage
using System;
using System.Collections.Generic;
using System.Text;
namespace Pattern.AbstractFactory
{
/**//// <summary>
/// 操作Message抽象類(AbstractProduct)
/// </summary>
public abstract class AbstractMessage
{
/**//// <summary>
/// 插入Message
/// </summary>
/// <param name="amm">AbstractMessageModel</param>
/// <returns></returns>
public abstract string Insert(AbstractMessageModel amm);
}
}