サービス指向アーキテクチャでアプリケーションを開発する際に、サービス コールのプロトタイプ/シグネチャを定義するベスト プラクティスは何ですか。
たとえば、メールを送信するためのサービス呼び出しを作成したいとします。
ドメインレイヤーに次のオブジェクトがあるとしましょう
[datacontract]
public class Email
{
public string To { get; set; }
public string From { get; set; }
public string Message { get; set; }
public string Subject { get; set; }
//I am not going to use this properties in send email method
public string OtherProp1 {get; set;}
public string OtherProp2 {get; set;}
public string OtherProp3 {get; set;}
}
次のようなサービスメソッド署名を作成する必要があります
public bool SendEmail(string from,string to, string subject,string message){//My Logic}}
または
public bool SendEmail(Email myEmail){//My Logic}
私は最初のオプションに傾いています。