In my previous posts, I have modeled a fighter and a fighter's body conditions, now I will model the academy which trains the fighters.
Below you will find abstract classes and concrete classes for a fighter training system. You will find classes for regional fighter academies along with classes for fighters a academy can train. Each regional academy can decide how they will train the fighters.
First of all, a fighter academy is just an abstract brand, such as ShaoLin Temple, Karate Institute or Aikido Dojo... A fighter get trained under ShaoLin temple only told us it should have some characters and qualities, but did not restrict how they should get trained. In another words, the detailed training plan is the decision of a specific regional ShaoLin Temple, no matter it's ShongShan mountain ShaoLin Temple or New York City ShaoLin Temple. We model this with factory method design pattern. While abstract class FighterAcademy guaranteed to return a qualified fighter, the concrete class NYCShaoLinTemple make it happen by making the actual training plan in the method trainFighter().
As a common challenge all brands face, we need a quality control mechanism. For example, Jack wants to open an ObjvillKarateInstitute today, he can't claim his institute to be a qualified fighter academy until he hires a licensed fighter. Only through the licensed fighter, we can call method TrainSpeed(), TrainPower(), TrainFlexibility(), TrainReflection(), TrainStagama(). Here the abstract factory come into play.
This blog is about Ad-Hoc knowledge spreading to broad range of spectrum: software, electronics, computer hardware, wireless, system engineer, IoT, information security, NLP, Cloud, AI, ML, E-commerce, blog, search engine...Internet is ran by do good individuals, wish the knowledge be with you.
Subscribe to:
Post Comments (Atom)
meta.ai impression
Meta.ai is released by meta yesterday, it is super fast you can generate image while typing! You can ask meta.ai to draw a cat with curvy fu...
-
1. Digg 2. Twitter 3. FriendFeed 4. Reddit 5. Hacker News 6. Facebook 7. MySpace 8. LinkedIn 9. Flixster 10. Flickr
-
It is super easy. On the top-right hand of youtube page, there is a textbox labeled "embed". Just copy the content in the textbox,...
-
Show   Hide Here is the text you would like to show --------------------------------------------------------------------------- I f...
No comments:
Post a Comment