0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【保険商品管理システムの開発】自動車保険のシュミレーション画面のインターフェースを作成

0
Posted at
Services/IAutoPremiumCalculator.cs
using InsuranceProductManager2.Models;

namespace InsuranceProductManager2.Services
{
    public interface IAutoPremiumCalculator
    {
        AutoPremiumCalculationResult CalculatePremium(Customer customer, AutoInsurancePolicy policy);
    }
}

・この IAutoPremiumCalculator は「計算ロジックの型(契約書)」であり、
実際の計算処理は 別のクラス がこのインターフェースを「実装(implement)」します。

・メリットは、単体テストのしやすさ、別クラスに差し替えがしやすい等です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?