agile2011 object card

25
S.A. Java Execute the class that has the first parameter name. Step-0 1 / 49

Upload: tsuyoshi-ushio

Post on 01-Nov-2014

984 views

Category:

Technology


0 download

DESCRIPTION

Agile2011 sessionAgile Education by Object Game Most HISSATSU Way to understand it.Please download with presentation

TRANSCRIPT

Page 1: Agile2011 Object Card

S.A. �

Java�

Execute the class that has the first parameter name.�

Step-0 1 / 49

Page 2: Agile2011 Object Card

S.A. �

Manager�Represent a manager�

Execute  ・instantiate(new) Singer � with the data “name =� Michael height = 5.5” � ・command him to sing � ・command him to dance �

Step-0

Singer: michael

2 / 49

Note: This class can be executed without instantiate.

Page 3: Agile2011 Object Card

S.A. �

Singer�Singer Role�

Manage “name”�Manage “height”�sing � ・Display “(name) is singing.”�

dance � ・Display “(name) is dancing.��

Step-0

name

height

3 / 49

Page 4: Agile2011 Object Card

S.A. �

1:Singer�Singer Role�

Manage “name”�Manage “height”�sing � ・Display “(name) is singing.”�

dance � ・Display “(name) is dancing.��

Step-0

name

height

4 / 49

Page 5: Agile2011 Object Card

S.A. �

Screen �

Step-0,1,2 5 / 49

Page 6: Agile2011 Object Card

S.A. �

Java�

Execute the class that has the first parameter name and pass the other parameters.

If you’ll get an Runtime Exception,

catch it and show the message of it.

Step-1 Step-1,2 6 / 49

Page 7: Agile2011 Object Card

S.A. �

President�Represent a president�

Execute � ・instantiate(new) Employee � Factory �

・Get an Employee from � EmployeeFactory with the � second parameter.�

 ・Command Employee to � standup�

Step-1 Step-1

Note: This class can be executed without instantiate.

Employee factory : factory

Employee : employee

7 / 49

Page 8: Agile2011 Object Card

S.A. �

EmployeeFactory�Role: instantiate Employees�

Return an Employee

・If you get “new”, instantiate� (new) BrandNewEmployee and � return it.��

・If you get “mid”, � instantiate (new) � MidLevelEmployee and � return it.�

・If you get “exp”,� instantiate (new) � ExperiencedEmployee and � return it.�

If there is no proper Employee, set “No such a title employee.” to RuntimeException and throw it.�

Step-1,2 8 / 49

Page 9: Agile2011 Object Card

S.A. �

1:EmployeeFactory�Role: instantiate Employees�

If there is no proper Employee, set “No such title employee.” to RuntimeException and throw it.�

Step-1,2 9 / 49

Return an Employee

・If you get “new”, instantiate� (new) BrandNewEmployee and � return it.�

・If you get “mid”, � instantiate (new) � MidLevelEmployee and � return it.�

・If you get “exp”,� instantiate (new) � ExperiencedEmployee and � return it. �

Page 10: Agile2011 Object Card

S.A. �

Employee�Represent an Employee�

standup�

Step-1 10 / 49

Page 11: Agile2011 Object Card

S.A. �

BrandNewEmployee(Employee)�

Represent a brand new Employee�standup� ・display “A brand new � employee normally stands � up!” �

Step-1 11 / 49

Page 12: Agile2011 Object Card

S.A. �

MidLevelEmployee(Employee)�

Represent a mid-level Employee�standup� ・display “A mid-level � employee quickly � stands up!” �

Step-1 12 / 49

Page 13: Agile2011 Object Card

S.A. �

ExperiencedEmployee(Employee)�

Represent an experienced Employee�standup� ・display “A experienced� employee slowly stands up!” �

Step-1 13 / 49

Page 14: Agile2011 Object Card

S.A. �

2:BrandNewEmployee(Employee)�

Represent a brand new Employee�standup� ・display “A brand new � employee normally � stands up!” �

Step-1 14 / 49

Page 15: Agile2011 Object Card

S.A. �

3:MidLevelEmployee(Employee)�

Represent a mid-level Employee�standup� ・display “A mid-level� employee quickly � stands up!” �

Step-1 15 / 49

Page 16: Agile2011 Object Card

S.A. �

4:ExperiencedEmployee(Employee)�

Represent a Manager Employee�

standup� ・display “A experienced� employee slowly stands up!” �

Step-1 16 / 49

Page 17: Agile2011 Object Card

S.A. �

RuntimeException(Exception)�Represent Runtime Exception�

Step-2

Manage “error message” �

17 / 49

Error message

Page 18: Agile2011 Object Card

S.A. �

President�Represent a president�

Execute � ・instantiate(new) Employee � Factory. �

・Get an Employee from � EmployeeFactory with the � second parameter.�

 ・Command Employee to � standup.�

・Pass Employee the third � parameter as a base salary.�

・ask(get) salary from Employee �

・Display “Employee’s salary is � (salary) yen.”�

Step-2

Note: This class can be executed without instantiate.

Employee factory : factory

Employee : employee

18 / 49

Page 19: Agile2011 Object Card

S.A. �

Employee�Represent an Employee�

standup

manage “baseSalary” getSalary�

Step-1 19 / 49

base salary

Page 20: Agile2011 Object Card

S.A. �

BrandNewEmployee(Employee)�

Represent a brand new Employee�standup� ・display “A brand new � employee normally � stands up!” �

Step-1 20 / 49

getSalary  ・return baseSalary as salary �

Page 21: Agile2011 Object Card

S.A. �

MidLevelEmployee(Employee)�

Represent a mid-level Employee�standup� ・display “A mid-level � employee quickly � stands up!” �

Step-1 21 / 49

getSalary  ・return baseSalary x 2 + 1� as salary �

Page 22: Agile2011 Object Card

S.A. �

ExperiencedEmployee(Employee)�

Represent an experienced Employee�standup� ・display “an experienced � employee quickly stands up!” �

Step-1 22 / 49

getSalary  ・return baseSalary x 3� as salary �

Page 23: Agile2011 Object Card

S.A. �

2:BrandNewEmployee(Employee)�

Represent a brand new Employee�standup� ・display “A brand new � employee normally � stands up!” �

Step-1 23 / 49

getSalary  ・return baseSalary as salary �

base salary Manage “baseSalary”�

Page 24: Agile2011 Object Card

S.A. �

3:MidLevelEmployee(Employee)�

Represent a mid-level Employee�standup� ・display “A mid-level � employee quickly � stands up!” �

Step-1 24 / 49

getSalary  ・return baseSalary x 2 + 1� as salary �

base salary Manage “baseSalary”�

Page 25: Agile2011 Object Card

S.A. �

4:ExperiencedEmployee(Employee)�

Represent an experienced Employee�standup� ・display “an experienced � employee quickly stands up!” �

Step-1 25 / 49

getSalary  ・return baseSalary x 3� as salary �

base salary Manage “baseSalary”�