220 likes | 235 Views
Construction. Lecture Oo20 Gymnastics System Example Cont’d. References. The Booch Method Guide, for Rose 2.0 Fowler & Scott, UML Distilled Applying the Standard Object Modeling Language, AWL, 1997, Chapt 2. Teaching Points. Design activities Implementation classes. Review.
E N D
Construction Lecture Oo20 Gymnastics System Example Cont’d
References • The Booch Method Guide, for Rose 2.0 • Fowler & Scott, UML Distilled Applying the Standard Object Modeling Language, AWL, 1997, Chapt 2
Teaching Points • Design activities • Implementation classes
Review • How would you protect your architecture from a change in DBMS? • What is an executable release plan?
Design Activities • Reapplication of the micro process but at a greater level of detail • Less Abstract • Specification and Implementation perspectives used
Identify Key Abstraction • Now we identify abstractions in the solution domain • Classes needed to describe How we will solve the problem • Introduce controller classes
Relationships Navigation paths specified where needed for association relationships Some associations converted to aggregation or dependency Container classes introduced for 1 to many relationships
Attributes Specify field or reference Access control specified
Operations Algorithms described in more detail Access control
Executable release: Scoring Report Goal: Verification and successful use of navigational paths and score derivation logic for the scores of a competition. Start Date: 26 Aug 98 Effort: 12 developer-weeks Classes to be implemented: Competition, Event, Trial, RawScore, Team Use Cases to be Implemented: Scoring Inputs: Dummy database (validated in advance) with a meet, a competition, all events for that competition, all competing teams and gymnasts for the competition, and all trials and raw scores. Outputs: The data needed to build the report on Figure 4-3, “Output of the Gymnastics System,” on page 25 of requirement spec. A DB utility dump of the raw input for comparison.
Meet: Town InvitationalCompetition: Women’s Senior TeamDate: 12/3/92
Scoring Algorithm English: Each judge rates each gymnast on the event and reports the score to a scorekeeper. The scorekeeper throws out the high and low scores and averages the rest. This is the gymnast’s score for the event.
Scoring Algorithm Score score(){ Score net_score = scores.first(); //Iterate over the scores and sum while(!scores.done()) { net_score = net_score + scores.next(); scores.next(); } //Throw out the low and high net_score=net_score-(scores.min()+scores.max()); //average by scores used net_score=net_score/(scores.length()-2); return net_score; }
Class name: Trial Category: Contests Documentation: A trial is a single performance of a gymnast at a given event. The gymnast may attempt multiple trials at the same event (i.e. on the same piece of equipment). Each trial is scored separately by the judging panel. Each judge's score is associated with the trial by using the method addScore(). The gymnast's resulting score for the trial is obtained by calling the method score(). External Documents: Export Control: Public Cardinality: n Hierarchy: Superclasses: none Associations: competetor : Gymnast in association <unnamed> scores : TrialScoreList in association <unnamed> <no rolename> : Event in association <unnamed> Public Interface: Operations: addScore score State machine: No Concurrency: Sequential Persistence: Persistent
Operation name: addScore Public member of: Trial Arguments: Score newScore EventJudge scoringJudge Documentation: Adds a score and judge pair (RawScore) to the trial's set of scores. The set of scores represents the raw set scores provided by the judging panel. Normally each member of the judging panel will provide one score. Concurrency: Sequential
Operation name: score Public member of: Trial Return Class: Score Documentation: Computes a trial's overall score based on dropping the highest and lowest scores and averaging the rest. { Score net_score = scores.first(); //Iterate over the scores and sum while(!scores.done()) { net_score = net_score + scores.next(); scores.next(); } //Throw out the low and high net_score=net_score-scores.min()+scores.max()); //average by scores used net_score=net_score/(scores.length()-2); return net_score; } Concurrency: Sequential
Teaching Points • Design activities • Implementation classes