当前位置:网站首页>Problems in four color prototype modeling

Problems in four color prototype modeling

2021-05-04 16:53:13 Jiedao jdon

Recently, I'm learning about four-color prototype modeling , But there are some ambiguities in the actual modeling , It's better to give an example of a practical point , such as “ Create teams ” This activity , The business rules involved are like this :

1、 Each team contains at least 11 player , In the beginning, only 11 player

2、 There can only be one team per player

This is my understanding :

PPT:Manager( The player )、Team( The team )、Footballer( players )

DESC:TeamDesc( Team description )、FootballerDesc( Player description )

MI:CreateTeamMI( Create teams MI)

Role:????

here Role I'm not sure , If you insist on abstracting one , Then here Role It should be TeamCreaterRole( Team builder role ),Manager Contains its reference , Here's the picture :


Above picture Team It's an aggregate root , And it's an entity , The rest are like Footballer、TeamDesc、FootballerDesc Are all VO, Let's not think about factories to create teams , Focus on the four color prototype design .

There are still some unclear issues :

1、FootballerDesc: Should we extract the public attributes of all players ? For example, there are attacks 、 Defensive attributes , It's just the players ID 了 , thus Footballer There is only one property in the class

2、 If there is one more “ Player position ” Properties of , Different locations have different key attributes , That is, every player has 10 Attributes , But depending on the location , There are also different types of key attributes , In that case , It will abstract out a Seat( Player position ) Class , So this class and Footballer、Team What's the relationship between ?

My understanding is that :Team Can hold a Seat Set , Then each Seat For a player , namely Team Not directly related to the players , There should be one “ Check all players on the court ” Of MI You can directly find... Through this association , Players who don't play can use a special position “Bench”

[ The quilt wilsonp On 2014-01-15 18:33 A modified ]

版权声明
本文为[Jiedao jdon]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/05/20210504164658117M.html

随机推荐