私はエンタープライズ向けのMicrosoft.Netソリューションの設計を読んでおり、プレゼンターとサービスレイヤーに関していくつかのことを理解しようとしています。
まず、Presenterは、initialize()、save()など、サービスレイヤーに存在するメソッドを呼び出す必要があります。しかし、サービスレイヤーへの参照はどこに配置しますか?プレゼンターでクラスレベルにする必要がありますか、それともプレゼンターメソッド自体で新しいサービスを定義する必要がありますか?
第二に、これは本でもあまり明確ではありませんが、これはプレゼンターからサービスレイヤーへの処理がどのように機能するのですか?:
public void ProcessPrediction()
{
//Get the data from the View
string selectedForPolePosition = predictionPageView.DriverPolePosition;
string selectedForSecondPosition = predictionPageView.DriverSecondPosition;
string selectedForThirdPosition = predictionPageView.DriverThirdPosition;
string selectedForFourthPosition = predictionPageView.DriverFourthPosition;
string selectedForFifthPosition = predictionPageView.DriverFifthPosition;
string raceTitle = predictionPageView.RaceTitle;
//Prepare for sending to the Service Layer
PredictionDTO prediction = new PredictionDTO();
prediction.RaceTitle = raceTitle;
//More Filling of the DTO here....
//...
//...
IPredictionService predictionService = new PredictionService();
predictionService.ProcessPrediction(prediction);
}