コード例 #1
0
ファイル: RomanceOMeter.cs プロジェクト: elbandit/PPPDDD
        // stateless - collaborators are allowed, though

        // behavior-only
        public CompatibilityRating AssessCompatibility(LoveSeeker seeker1, LoveSeeker seeker2)
        {
            var rating = new CompatibilityRating();

            // orchestrate Entities:
            // compare dating history, blood type, lifestyle etc
            if (seeker1.BloodType == seeker2.BloodType)
            {
                rating = rating.Boost(CompatibilityRating(250));
            }

            // ..

            // return another Domain Object (Value Object in this case)
            return rating;
        }
        // stateless - collaborators are allowed, though

        // behavior-only
        public CompatibilityRating AssessCompatibility(LoveSeeker seeker1, LoveSeeker seeker2)
        {
            var rating = new CompatibilityRating();

            // orchestrate Entities:
            // compare dating history, blood type, lifestyle etc
            if (seeker1.BloodType == seeker2.BloodType)
            {
                rating = rating.Boost(CompatibilityRating(250));
            }

            // ..

            // return another Domain Object (Value Object in this case)
            return(rating);
        }
コード例 #3
0
 public CompatibilityRating Boost(CompatibilityRating rating)
 {
     // ..
     return(null);
 }
コード例 #4
0
 public CompatibilityRating Boost(CompatibilityRating rating)
 {
     // ..
     return null;
 }