38
www.takumi-businessplace.co.jp Agile Education by Object Game Most HiSSATSU WAY to Undestand it. Tsuyoshi Ushio

TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Agile Education by Object Game �

匠Business Place 牛尾 剛 2011年8月11日(THU)

Most HiSSATSU WAY to Undestand it.

Tsuyoshi Ushio

Page 2: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Tsuyoshi Ushio�

v  Consultant, Samurai of Agile v  Agile, OO, Business Analysis , Project Manager v  2001 - 2005 Agile Programmer, PM , Join Community(XP-Jug in Japan) v  2003 Agile2003, wrote OO/Agile Best Seller Book in Japan v  2006 - 2009 Consultant v  2009 CEO of SimpleArchitect v  2011 Established E-Agility(Community) v  Vocalist of Za Michael.

Page 3: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

The mean of “HISSATSU” �

必殺 HISSATSU

Samurai Term. If you use HISSATSU technique, you’ll always kill the enemy. → Extremely effective.

Mondo Nakamura

http://jitekichi.blog26.fc2.com/blog-entry-872.html

Osaka no Obachan

http://ansaikuropedia.org/wiki/大阪のおばちゃん_

Page 4: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Agenda�

v  Why Object-oriented needed for agile? (20 min) v  How to obtain Object Brains with Object Game?(60min) v  Reflect of the Object Game(10min) v  Appendix

Page 5: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Why Object Oriented is needed for Agile?�

Embrace Change!

Evolutionary Design

Continuous Integration

Communication

Iteration

:

Object Oriented

TDD, Refactoring

Mechanism

But , some people never understand it.

Page 6: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Why some people couldn’t understand OO?�

v No Time v Fear of OO v Threshold�

Page 7: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Learning carve of Object Oriented�

First BIG Awareness of OO

Awareness Join OO Project�

Learners can’t feel progress before First BIG Awareness

Obtain Object Brains!�

Time

Skill

Threshold

Object Brain

Page 8: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

What is Object Brain?�

v Learner can imagine Behavior and Role of OO

v Learner can grab OO concepts and implementations

v Learner can feel the merit of OO v A-Ha!�

Object Game is the solution!

Page 9: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Learner can feel “Oh! Finally I’ve got an object oriented brain!” �

A-Ha

Page 10: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Object Game �

v Simple and effective v Goal is to understand real Application. v If you understand that’s overview of role

and behavior, stage cleared. No details. v No Cording v Has been created since 2006

Just do it!

Page 11: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Game Process �

How to play Object Game�

Prepare a pencil, eraser and real app.�

Place the cards�

Take a part of a card �

Execute the program�

Execute the scenarios by object game�

Compare the result�

By default, A person per a card But allow to have multi cards.

Execute real applications.

If you don’t understand it, repeat It 3times.

Listen to the explanation and Feel the concept.

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Page 12: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Scenario�

Setting and parts�

> java Manager�Michael is singing. �Michael is dancing. �

Java Manager Singer

This is the “Command the Singer” program.

This program has a Manager class to command

he singer.

Screen

Person A Person B

Person C

Place the cards�

Take a part of cards�

Execute it�

First Step�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Page 13: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

First Step Cards �

Manage “name” data�Manage “height” data �Sleep �  Display “(name) is sleeping.”

Eat

  Display “(name) is sleeping.”�

Singer�

Person Role�

Manager�

Manager Role�execute � ・instantiate Programmer and give it to the data “name = “Michael”, height = 5.5”

・Eat (order to programmer) �

・Sleep (order to programmer).�

Java �

Execute the class what name of the first parameter�

Screen �

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

name

height

Page 14: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

HISSATSU example to obtain Object Brain! �

v Experience Polymorphism, instantiate, behavior, inheritance and encapsulation.

v  Experience “exception”. v  Experience “change”. v  Learner can feel real application. v  and OOP Merits.�

This example cover these!

Page 15: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

President commands “stand up!” �

Stand up

President Waiting room

Situation �

President realize that the man is his employee.�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Brand new Employee , Tommy Mid-Level Employee, Michael Experienced Employee, Steve will stand up. All of them are Employees.�

Stand up but it has different style.�Brand new Employee : Just Stand up�Mid-Level Employee : Quickly Standup Experienced Employee : Slowly Standup�

Page 16: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

President command “Stand up!” Step1�Scenario�

Position and Role�

Employee

Screen

> java President new�A brand new employee just stands up. �> java President mid �

A mid-level employee stands up quickly. �> java President exp �

A experienced employee stands up slowly. �

Let’s understand this Application�

BradNewEmployee(Employee)

President

Employee Factory

Java

Person A Person B

Person C

> java President mst �

> No such a level of an employee.�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

MidLevelEmployee(Employee)

ExperiencedEmployee(Employee)

Person D

Page 17: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Scenario� > java President new 100 A brand new employee just stands up!Employee's salary is 100yen.

>java President mid 100 A mid-level employee quickly stands up!Employee's salary is 201yen.

> java President exp 100 A experienced employee slowly stands up!Employee's salary is 300yen. �

Add a new function�

Brand New Employee�  salary = base Salary.�Mid-Level Employee�  salary = base Salary x 2 + 1 Experienced Employee�  salary = base Salary x 3

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

President command “Stand up!” Step2�

Position and Role�

Employee

Screen

BradNewEmployee(Employee)

President

Employee Factory

Java

Person A Person B

Person C

MidLevelEmployee(Employee)

ExperiencedEmployee(Employee)

Person D

Page 18: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Scenario�Quiz:How to add this function?

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

> java President new 100 A brand new employee just stands up!Employee's salary is 100yen.

>java President mid 100 A mid-level employee quickly stands up!Employee's salary is 201yen.

>java President exp 100 A experienced employee slowly stands up!Employee's salary is 300yen.

>java President snr 100 A senior-level employee wearily stands up!�Employee’s salary is 402yen.

Brand New Employee�  salary = base Salary.�Mid-Level Employee�  salary = base Salary x 2 + 1 Experienced Employee�  salary = base Salary x 3 Senior-Level Employee salary = base Salary x 4 + 2

Position and Role�

President command “Stand up!” Step3�

Page 19: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Scenario�This is it.�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Brand New Employee�  salary = base Salary.�Mid-Level Employee�  salary = base Salary x 2 + 1 Experienced Employee�  salary = base Salary x 3 Senior-Level Employee salary = base Salary x 4 + 2

President command “Stand up!” Step3�

Position and Role�

Employee

Screen

BradNewEmployee(Employee)

President

Employee Factory

Java

MidLevelEmployee(Employee)

ExperiencedEmployee(Employee)

> java President new 100 A brand new employee just stands up!Employee's salary is 100yen.

>java President mid 100 A mid-level employee quickly stands up!Employee's salary is 201yen.

>java President exp 100 A experienced employee slowly stands up!Employee's salary is 300yen.

>java President snr 100 A senior-level employee wearily stands up! Employee’s salary is 402yen.

Senior-Level Employee(Employee)

Page 20: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Scenario�Add function

Calculate bonus�All Employees � bonus = base Salary x 3�

President command “Stand up!” Step4�

>java President new 100 A brand new employee just stands up!Employee‘s salary is 100yen. Employee’s Bonus is 300yen.�

>java President mid 100 A mid-level employee quickly stands up!Employee's salary is 201yen. Employee’s Bonus is 300yen.

>java President exp 100 A experienced employee slowly stands up!Employee's salary is 300yen. Employee’s Bonus is 300yen.

>java President snr 100 A senior-level employee wearily stands up! Employee’s salary is 402yen. Employee’s Bonus is 300yen.

Position and Role�

Employee

Screen

BradNewEmployee(Employee)

President

Employee Factory

Java

MidLevelEmployee(Employee)

ExperiencedEmployee(Employee)

Senior-Level Employee(Employee)

Page 21: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Point of making Object Brain�

v Experience and Explain v Observe them v Don’t be too strict.(like baby learning)

Page 22: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Results of the Object Game �

v Learner can easily understand OO based technique

v Can experience and feel OO and patterns. v Can understand an architecture. v No coding and Fast!

http://store.shopping.yahoo.co.jp/sincere-inc/shuriken.html

Page 23: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Do you understand it?�

Object Game � Learners can understand it in 4 hours.�

  Tomcat Request from browser

<XML> <XML>

Controller

Login Form

Action

ViewAction LoginAction

login.jsp

menu.jsp

User Service

User

User DAO

User table

Tableuser_id :Yoda user_name:Tomoo password:sennuki

web.xml struts-config.xml

user :pass :

login

Login

Hello!Tomoo!

http://localhost:8080/sample/LoginAction.do

Learners can understand it

Even if they don’t have

experience of coding.

Page 24: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Results of the Object Game �

v Learner can easily understand OO based technique

v Can experience and feel OO and patterns. v Can understand an architecture. v No coding and Fast! v Learner thinks “finally, I can handle the

Object Oriented!”

Page 25: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Side Effects Story�

Learner gets Object Brain

I can handle it! I can understand!

Gain Motivation!

Reduce Fear!

Side Effects

Page 26: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Thanks for enjoying this session!

Tsuyoshi Ushio (牛尾 剛) Twitter :@sandayuu E-mail  : [email protected]

If you want to get an object brain, please talk to me after this session. I’ll do this method for you in this conference.

Page 27: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

APPENDIX�The rule of the Object Game.�

Page 28: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Unit of program�

Class�

Small piece of a program. Represented by a card in this game. �

Divided by Responsibility�

Template of instance�

A class is a collection of objects. �

Ex. Product, Order, etc… � Person �

Represent Person�

Manage “name” data�Manage “height” data�sleep �  Display “(name) is sleeping.”�eat�

Class Name�

behavior�

Just Experience It!�

Responsibility of class�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

name

height

Class Role�

Attribute �

Page 29: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Rule �

Instantiate(new)�

Before you ask a work to class, make instance from class.�

Person �

Person Role�

Manage “name” data�Manage “height” data �Sleep �  Display “(name) is sleeping.”

Eat�

Class Card�

name

height

1:Person �

Person Role�name

height

Michael

5.11

2:Person �

Person Role�name

height

Stevie

6.00

Unique number (Address)�

Instance Card�

Manage “name” data�Manage “height” data �Sleep �  Display “(name) is sleeping.”

Eat�

Manage “name” data�Manage “height” data �Sleep �  Display “(name) is sleeping.”

Eat�

Page 30: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Non Class Card�

Runtime, Configuration File, others.�

Runtime , screen , configuration files .. become cards.�

Java�

Execute the first attribute name’s class.�

Name of Application�

Behavior�

Screen �

Write it by pencil.�

Michael is sleeping.

Page 31: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Message Patterns �

v Send Message q No parameter pattern�

Stand up!�

Point your own card.�

Tap the card owner’s shoulder�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Page 32: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Message Patterns �

Give me a Employee! This is an experienced Employee, OK? Order the job with Post-it.

v Send Message

q With parameters�

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Page 33: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Message Patterns �

①Pass the card �

②Pass the person with card.�

①Order with passing the card.� ②Order with passing the person.�

v Send Message

q With an Instance �

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Page 34: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Inheritance �

Employee�

Represent an Employee �

standup

Manage “baseSalary”

GetSalary �

BrandNewEmployee(Employee)� MidLevelEmployee(Employee)� ExperiencedEmployee(Employee)�

Represent a brand new Employee �

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

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

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

Shows Is-a releation�

Interface Abstract class Or Class�

You don’t need to write Superclass method in the concrete class methods�

Ex. Brand new Employee, Mid-Level Employee and Experienced Employee Are an Employee

NOTICE: This example is not a good model for OO-Modeling. See Baby Learning Section.

You can write abstract method.

getSalary  ・return baseSalary as salary �

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

getSalary  ・return baseSalary x 3� as salary �

Page 35: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Polymorphism image �

③Return Mid-Level Employee ( Employee )�

Instantiate Mid-Level Employee �

Mr.C hide Mid-Level Employee card from Others and point the Employee card.�Mr.B returns Mr.C with cards to Mrs.A �Mrs.A realize Mr.C as an Employee.�

①Point the cards

②Instantiate �

Employee

BrandNew(Emp) Mid(Emp) Exp(Emp)

President EmployeeFactory

Mrs.A ��

Mr.C ��

Mr.B ��

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Mrs.A dosen’t realize Mr.C as a mid-level employee.�

Page 36: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Exception�

Object Game can represent the exceptions. Just throw and catch it!�

President

Pass the Exception card�

EmployeeFactory

Exception�

Throw the Exception �

Java

Catch the Exception�

If card has not Role to catch it, throw it to caller�

Exception �

Java can catch it. Process the Exception!�

President has no role to catch it

Copyright(C) 2009 Takumi Business Place Corporation All Rights Reserved.

Page 37: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Rule �

References�

employees belongs to a division.�

1:Division�

Division Role�

code

name

SL01

sales

2:Employee�

name

sales

Stevie

1,000,000 Manage “code” data�Manage “name” data � add(Employee) calcTotalSalary

Manage “name” data�Manage “sales” data �

2 3 employees

3:Employee�

name

sales

Stevie

1,000,000

Manage “name” data�Manage “sales” data �

Employee Role�

Page 38: TSU estand Agile Education · 2019. 12. 16. · Agile Education by Object Game 匠Business Place 牛尾 剛 2011年8月11日(THU) TSU estand. Tsuyoshi Ushio Tsuyoshi Ushio !

www.takumi-businessplace.co.jp

Thanks a lot!