25
Object Thinking

Object Thinking. Alan Dean, Senior Technologist [email protected]

Embed Size (px)

Citation preview

Page 1: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Object Thinking

Page 2: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Alan Dean, Senior Technologist

[email protected]

http://www.charteris.com/

Page 3: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Charteris helps leading organisations transform their business performance through the strategic application of technology.

We focus on three key business areas:helping clients adopt a customer-centric approach;

implementing solutions that deliver an integrated enterprise;

and achieving operational excellence though infrastructure optimisation.

With our rare blend of business expertise and technological flair we provide impartial advice and advanced solutions based on the latest proven technologies – bridging the gap between business and technology to enable the agile enterprise.

Our technology skills are complemented by business consulting specialists in business transformation, programme management, strategic sourcing, advanced Microsoft application development, advanced infrastructure consulting and Microsoft Dynamics AX.

Page 4: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com
Page 5: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

The Philosophy of Developmentformalism -vs- hermeneutics

From Philosophy to Culturementoring, metaphor &

vocabulary

From Culture to Practiceobject discovery & thinking

Page 6: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Formalism/Determinism(software engineering)

uses traditional thinking

-vs-

Hermeneutics/Postmodernism(extreme programming)

uses object thinking

Page 7: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

The Object Thinking Manifesto

Advocacy of behavioralismAntagonistic towards formalism

Emphasis on analysis and conceptualization

Philosophy of extreme programming

Prefers the autonomous to the autocratic

Page 8: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

The Object Thinking Manifesto

Better people write better code

- not better tools

Page 9: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

“Let there be no doubt that object-oriented design is fundamentally

different than traditional structured design approaches:

it requires different ways of thinking about decomposition, and it

produces software architectures that are largely outside the realm of the

structured design culture.”Grady Booch, 1991

Page 10: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

“Let there be no doubt that object-oriented design is fundamentally

different than traditional structured design approaches:

it requires different ways of thinking about decomposition, and it

produces software architectures that are largely outside the realm of the

structured design culture.”Grady Booch, 1991

Page 11: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Observing the Object Difference

Traditional thinking Object thinking

Data Structure

operationX

operationY

operationZ

Page 12: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Anthropomorphizationis the attribution of human

characteristics to inanimate objects,

animals, forces of nature, the unseen author of things, and others.

Page 13: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

“… if the diagram is an accurate depiction of an object, what is

the difference between an object and a COBOL program?”

Page 14: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

“There is none. A COBOL program encapsulates data and

operations and allows communication among

programs. Object development – using this model – will have a

tough time being anything more than the creation of lots of tiny

COBOL programs.”

Page 15: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Object Depictions

Entity UML

Customer

ID#dobgenderfname…

getID#setID#getDOB#setDOB#…

Customer

id#dobgenderfnamelnamemihonorificgenerational…

Page 16: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Object Depictions

Object (Class-Responsibility-Collaboration)

Customer

ID selfdescribe selfindicate desiresmake decisionsconfirm information

Page 17: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Encapsulation via Properties

public class Customer{ public string Name { get { return _name; } set { // validate here _name = value; } }

private string _name;}

• Known as information hiding

• Traditionally taught as a key precept of OO

• But many XP advocates say they should not be tested … why?

• Why do objects keep trying to change type?

• Is there a better way?

Page 18: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Self-Describing Objectspublic class Customer : Dictionary<Uri,

Object>{ }

• Provides a property bucket

• Looks alien to traditional thinking

• Violates traditional encapsulation principles

• How is validation carried out?

Page 19: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Self-Evaluating Rules

Evaluate self-describing objects at runtime

Promote type re-use via separation of concerns

Embody data validation rules, business rules, or any other

constraint

Page 20: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Demo

Self-Describing Objects & Self-Evaluating Rules

Page 21: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

So all my objects should be self-describing?

Page 22: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Having a hammerdoes not make everything a nail

Page 23: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Non-Self-Describing Objects

Primitivesbool, int, float, enum, etc.

Some Standardshtml elements, xpath predicates, industry,

etc.

Self-Describing Objects tend to be actors

Page 24: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Issues

Currently no standard supporting frameworkI am starting a project on Google Code

Limited knowledge, few publications, no examples

Just try googling for the key terms…

Steep learning curveHard to ‘unlearn’ traditional thinking

Few practitioners or evangelists

Page 25: Object Thinking. Alan Dean, Senior Technologist alan.dean@charteris.com

Linkshttp://del.icio.us/alan.dean/object-

thinkinghttp://code.google.com/u/alan.dean/

[email protected]

© MMVII