2012-04-27 11 views
0

私はasp.netとModel View Presenterパターンを使用してショッピングウェブサイトを作成しており、アーキテクチャは階層化されています。私はビジネスレイヤーのユーザー入力の検証を担当するバリデータークラスを持っている必要があることを知っています。また、DEEPと高速ユーザーの応答に従うためにUIレイヤーにバリデーターが必要です。ですから、int型、long型、decimal型などのデータ型を検証するためにBLのバリデータークラスを持つことができますが、DRYとSOLIDにも従いますか?抽象化も必要ですか?ここ は私のモデルです:データを検証する方法

public class Category 
{ 
    public int Id {get;set;} 
    public string Name {get;set;} 
    public int? ParentCategory {get;set;} 
} 
public class Item 
{ 
    public int Id {get;set;} 
    public int Category {get;set;} 
    public string Model {get;set;} 
    public string Color {get;set;} 
    public string Brand {get;set;} 
    public decimal Price {get;set;} 
} 

答えて

関連する問題