UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies,...

54
UPE Presentation, 10/22/2003 Presented By: By: Blair Schneider McKay Blair Schneider McKay Consultant, Arrow Strategies, LLC. Consultant, Arrow Strategies, LLC. Current Project: Current Project: AT&T College and University Services AT&T College and University Services Ann Arbor, MI Ann Arbor, MI Email: Email: [email protected] [email protected] “Design Patterns” ~50 minutes “How to Keep an Information- Technology Job” ~20 minutes

Transcript of UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies,...

Page 1: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

UPE Presentation, 10/22/2003

Presented By: By:

Blair Schneider McKayBlair Schneider McKayConsultant, Arrow Strategies, LLC.Consultant, Arrow Strategies, LLC.

Current Project:Current Project:

AT&T College and University ServicesAT&T College and University Services

Ann Arbor, MIAnn Arbor, MI

Email: Email: [email protected]@compuserve.com

“Design Patterns” ~50 minutes

“How to Keep an Information-Technology Job”~20 minutes

Page 2: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 3: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Software Development Evolves

Some Some “Good”“Good” Practices: Practices: EncapsulationEncapsulation Separating Interface from ImplementationSeparating Interface from Implementation AbstractionAbstraction

Some Some “Bad”“Bad” Practices: Practices: Global DataGlobal Data Magic NumbersMagic Numbers Spaghetti LogicSpaghetti Logic

Tight CouplingTight Coupling

Page 4: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Tightly-Coupled Systems

Page 5: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Tightly-Coupled Systems

Page 6: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Layered Architectures

OSI 7-Layer Networking Model:OSI 7-Layer Networking Model:

Layer 1: PHYSICAL

Layer 2: DATA-LINK

Layer 3: NETWORK

Layer 4: TRANSPORT

Layer 5: SESSION

Layer 6: PRESENTATION

Layer 7: APPLICATION telnet, ftp, pop3, smtp

conversions, encrypt/decrypt, parts of odbc / html

cookies, “shopping basket” techniques, etc.

TCP, data reliability (re-transmission, etc.)

IP

ppp, slip, hdlc, token-ring, MAC addressing

NIC cards, RS-232, electrical characteristics

Page 7: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

RantAlert!RantAlert!RantAlert!

Layered Architectures –N-Tier Systems

PRESENTATION

APPLICATION

BUSINESS LOGIC

DATA

In the 1990s, many client-server shops adopted “all-in-one” In the 1990s, many client-server shops adopted “all-in-one” development platforms: PowerBuilder, Visual Basic, ASP, development platforms: PowerBuilder, Visual Basic, ASP, Centura/Gupta, “4Centura/Gupta, “4thth generation” db-tools and stored-procedure generation” db-tools and stored-procedure languages, and so forth.languages, and so forth.

Such tools tend to encourage code that spans many (or all!) Such tools tend to encourage code that spans many (or all!) layers. Systems built this way are layers. Systems built this way are massivelymassively coupled and hard to coupled and hard to maintain.maintain.

I believe this has damaged the overall reputation of software I believe this has damaged the overall reputation of software development.development.

RantAlert!

User interfaces. “Look and feel.”

Code re-used across applications and domains.

Code that addresses a one-time need.

Pass-through and acceleration/caching only.

(According to Blair…)

Page 8: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Design Patterns

Simple, elegant solutions to problems that occur in Simple, elegant solutions to problems that occur in a wide variety of applications and architectures.a wide variety of applications and architectures.

Canonical Canonical Reference::

“Design Patterns: Elements of Reusable Object-Oriented Software”by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (commonly referred to as “The Gang of Four” or “GoF”)Addison-Wesley, 1995. ISBN 0-201-63361-2

Language-independent (for the most part).Language-independent (for the most part).

Based on abstraction and the interrelationship Based on abstraction and the interrelationship between components. Generally not between components. Generally not concerned with the actual “job” of those concerned with the actual “job” of those components.components.

Page 9: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 10: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Adapter Pattern – Motivating Example

Imagine that you want to exploit the functionality of existing code – such as a third-party or open-source library – but you can’t (or would rather not) modify that code’s interface.

LibraryClass

Caller

Caller AdapterLibraryClass

Caller AdapterLibraryClass

Some useful adapters: ODBC, JDBC, Apache Portable Runtime (APR), The ACE Toolkit, POSIX, …

Page 11: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

AdapteeAdapter

Client Target

Request()

Request() ProprietaryRequest()

Adapter Pattern(Also called “Wrapper”)

Used to connect a caller to an existing class, often legacy or library code, when the caller requires a different interface.Object Adapter (Uses Composition):

(Diagram based on p. 141 in “Design Patterns”, by Gamma et al. Addison Wesley, 1995.)

Page 12: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Adaptee

Adapter

Client Target

Request()

Request()

ProprietaryRequest()

Adapter Pattern(Also called “Wrapper”)

Used to connect a caller to an existing class, often legacy or library code, when the caller requires a different interface.Class Adapter (Uses Multiple Inheritance):

(Diagram based on p. 141 in “Design Patterns”, by Gamma et al. Addison Wesley, 1995.)

Page 13: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

client.cpp

#include “Adapter.h“Adapter a;

// Calling-interface that I like:Rectangle box( Point(0, 100), Point(15, 55) );a.drawCircle( box );

Adapter Pattern Simple “Pass-Through” Implementation

ShapeMaster.h

class ShapeMaster {// Proprietary Interfacepublic: void RenderCircle( int h_pos, int v_pos, int radius ); void RenderTriangle( /* ... */ ); void RenderSquare( /* ... */ ); // ...}

Page 14: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Adapter Pattern Simple “Pass-Through” Implementation

Adapter.h

class Rectangle;class Point; class GGLib::ShapeMaster;

class Adapter {public: // ctors and such void drawCircle( const Rectangle& box );private: ShapeMaster* impl_;}// ...

Adapter.cpp

#include “Rectancle.h”#include “GreatGraphicsLib/ShapeMaster.h”

void Adapter::drawCircle( const Rectangle& box ) { int h_pos = ( box.point1.horizontal + box.point2.horizontal ) / 2 ;

int v_pos = ( box.point1.vertical + box.point2.vertical ) / 2 ; int radius = min(abs(box.point2.vertical – box.point1.vertical), abs(box.point2.horizontal – box.point1.horizontal)) / 2;

impl_->RenderCircle( h_pos, v_pos, radius );}

Page 15: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 16: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Bridge Pattern – (aka “Handle/Body”)

This is similar to adapter, but you build it into the class structure itself, rather than use it to wrap existing code.

ImplementationClient Abstraction

Request() RequestImpl()

The bridge is a natural extension of “Separate Interface from Implementation.” But here, classes relationships themselves provide the separation, rather than in-class language features.

Page 17: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Bridge Pattern – The C++ “pImpl” Idiom

Calculator.h

#include “Number.h”class CalculatorImpl;

class Calculator{public: Calculator(); virtual ~Calculator(); Number square_root( const Number& input ); Number natural_log( const Number& input ); // ...private: CalculatorImpl* pImpl_; // private implementation};

Calculator.cpp

#include “Calculator.h”#include “CalculatorImpl.h”

Calculator::Calculator() : pImpl_(new CalculatorImpl) { }

Calculator::~Calculator() { delete pImpl; }

Number Calculator::square_root( const Number& input ){ return pImpl_->square_root( input );}

Number Calculator::natural_log( const Number& input ){ return pImpl_->natural_log( input );}

Page 18: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

CalculatorImpl.h

#include “FrequentlyChangingClass1.h”#include “FrequentlyChangingClass2.h”#include “FrequentlyChangingClass3.h”#include “CostlyToCompile1.h”#include “CostlyToCompile2.h”#include “Number.h”

class CalculatorImpl{public: CalculatorImpl(); virtual ~CalculatorImpl(); Number square_root( const Number& input ); Number natural_log( const Number& input ); // ...private: CostlyToCompile1 cc1_; CostlyToCompile2 cc2_; // etc.};

Bridge Pattern – The C++ “pImpl” IdiomImplemented

Page 19: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 20: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

class Widget {

void f(int x) // “__f_int_(int x)” { std::cout << “The integer is “ << x << “\n”; }

void f(double d) // “__f_double_(double x)” { std::cout << “The double is “ << d << “\n”; }};

Brief Review of Polymorphism - 1

First off, it is not function overloading:

These are two completely different functions. The comment text (green) shows how a compiler might “mangle” their names internally to distinguish them.

Page 21: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Brief Review of Polymorphism - 2

Polymorphism is about handling different objects as if they were all the same. (Access through a common interface.)

Consider example of an “Aquarium” screen-saver:

Main program-loop iterates over a collection of “Sprites”, telling each sprite when to move. Even though the collection holds different types of objects, they can all be handled as if they were the same type.

Sprite

SharkGuppy Kelp Crab

Page 22: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Brief Review of Polymorphism - 3A

Here’s how not to design such a program . . .

Sprite.h

enum SpriteType { GUPPY, SHARK, CRAB, KELP };

class Sprite {public: virtual SpriteType type() const = 0; // ... };

Guppy.h

#include "Sprite.h"class Guppy : public Sprite {public: virtual SpriteType type() const { return GUPPY; } void swim(); // ... };

Page 23: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

SpriteTester1.cpp

void test_sprites1(SpriteList& list){ Sprite* s = list.first(); do { // THIS IS BAD CODE. DON'T DO THIS! switch(s->type()) { case GUPPY: { dynamic_cast<Guppy*>(s)->swim(); continue; } case CRAB: { dynamic_cast<Crab*>(s)->skuttle(); continue; } case KELP: { dynamic_cast<Kelp*>(s)->wave(); continue; } // other cases, like Shark, etc. ...

default: { throw std::exception("Unhandled Sprite!"); } } // switch } while ( (s = list.next()) != 0 );}

Brief Review of Polymorphism - 3BHow not to design such a program, continued . . .

Page 24: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Sprite.h

class Sprite {public: virtual void move() const = 0; // ... };

Brief Review of Polymorphism - 4AUsing polymorphism to avoid runtime type-checking:

Guppy.h

#include "Sprite.h"class Guppy : public Sprite {public: virtual void move(); // ... private: void swim(); // ... };

Guppy.cpp

void Guppy::move(){ swim(); };

Kelp.cpp

void Kelp::move(){ wave(); };

Crab.cpp

void Crab::move(){ skuttle(); };

Page 25: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Brief Review of Polymorphism - 4B

SpriteTester2.cpp

void test_sprites2(SpriteList& list){ Sprite* s = list.first(); do { // Much better implementation .... s->move(); } while ( (s = list.next()) != 0 );}

Using polymorphism to avoid runtime type-checking:

Page 26: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Module1.cpp#include "Shark.h"#include "Guppy.h"#include "Kelp.h"#include "Crab.h"// ...// Add randomly-selected sprite to SpriteList.int pctile = rand() % 100; // Random: 0 to 99

if ((pctile -= 80) < 0) // 80% chance sprites.push_back(new Guppy);

else if ((pctile -= 10) < 0) // 10% chance sprites.push_back(new Shark);

else sprites.push_back(new Crab); // remaining 10%

Fine, but what about creating objects?

Module2.cpp#include "Shark.h"#include "Guppy.h"#include "Kelp.h"#include "Crab.h"// ...// Accept user choice.char key = get_key_press();

if (key == 'g') sprites.push_back(new Guppy);

else if (key == 's') sprites.push_back(new Shark);

// ...

main.cpp#include "Shark.h"#include "Guppy.h"#include "Kelp.h"#include "Crab.h"// ...// Initialize SpriteList.srand(time(0));for (size_t i = 0; i < 10; ++i) {

int pctile = rand() % 100; // random:0 to 99

if ((pctile -= 80) < 0) // 80% chance sprites.push_back(new Guppy); else if ((pctile -= 5) < 0) // 5% chance sprites.push_back(new Shark); else if ((pctile -= 10) < 0) // 10% chance sprites.push_back(new Kelp); else sprites.push_back(new Crab); // remaining % }

Page 27: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Wouldn’t It Be Nice To Have a “Virtual Constructor”?

We do!We do!

It’s called the “It’s called the “Factory MethodFactory Method”.”.

Page 28: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Factory Method – Simplest Form

SpriteFactory.cpp

#include “SpriteFactory.h"#include "Shark.h"#include "Guppy.h"#include "Kelp.h"#include "Crab.h“

Sprite* getNewSprite() { int pctile = rand() % 100; // random:0 to 99

if ((pctile -= 80) < 0) // 80% chance return new Guppy; else if ((pctile -= 10) < 0) // 10% chance return new Shark; else if ((pctile -= 5) < 0) // 5% chance return new Kelp; else return new Crab; // remaining % }

SpriteFactory.h

class Sprite; // forward declarationSprite* getNewSprite();

main.cpp

#include “SpriteFactory.h”class Sprite; // optional forward declaration

SpriteList sprites;// ...// initialize SpriteListfor (size_t i=0; i<10; ++i) { sprites.push_back( getNewSprite() );}

// do something to SpriteListtest_sprites(sprites);

Page 29: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Parameterized Factory Method

SpriteFactory.cpp#include "SpriteFactory.h"#include "Shark.h"#include "Guppy.h"#include "Kelp.h"#include "Crab.h“#include "Quagga.h"#include <cassert>

Sprite* getNewSprite(SpriteType type) { switch (type) { case SHARK: return new Shark; case KELP: return new Kelp; case CRAB: return new Crab; case GUPPY: return new Guppy; case QUAGGA: return new Quagga; default: { assert(false && “Unhandled fish-type”); return new Guppy; }}Sprite* getNewSprite() { // ...

SpriteFactory.h

#include “Sprite.h”Sprite* getNewSprite(SpriteType type);Sprite* getNewSprite();

Module2.cpp

#include “SpriteFactory.h"// ...// Accept user choice.char key = get_key_press();SpriteType type = convertKeyPress(key);sprites.push_back( getNewSprite(type) );// ...

Page 30: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Using Full Objects as Factory Parameters

Pass the factory a pointer or reference to acontext object:

Product* create( Context* runState );

The factory then interrogates the context object for information about what sort of product is needed.

The context object could be the caller itself:

Product* createFromContext( this );

Page 31: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Stateful Factories

The Factory Method can be a member of a class, and can “remember” what it’s done before:

SpriteFactory.h

#include ”Sprite.h”

class SpriteFactory {public: SpriteFactory(); virtual ~SpriteFactory(); Sprite* getNewSprite(); Sprite* getNewSprite( SpriteType type ); private: Sprite* getNewSpriteImpl(); SpriteType last_type_created_; // ...};

SpriteFactory.cpp

#include “SpriteFactory.h"#include "Shark.h"#include "Guppy.h"#include "Kelp.h"#include "Crab.h“

SpriteFactory::SpriteFactory() : last_type_created_(GUPPY){}

Sprite* getNewSprite() { Sprite* ret = getNewSpriteImpl(); while ( ret->type() == last_type_created_ ) { ret = getNewSpriteImpl(); } last_one_created_ = ret->type(); return ret;}

// ...

Page 32: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Related Patterns – Prototype

class Guppy : public Sprite {public: Sprite* clone() const; // return copy of myself// ...}

Even the factory doesn’t need to know exactly how to build each product sub-class.

The sub-class itself can take on that responsibility.

SpriteFactory::SpriteList my_prototypes_;

Sprite* SpriteFactory::getSprite( SpriteType requested ) { for (/* ... each prototype in my list . . .*/) { if (prototype->type() == requested) return prototype->clone(); } // return default type or throw exception.}

Page 33: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Related Patterns – Abstract Factory

• In the Abstract Factory, the factory itself is polymorphic.

• Clients who want new products call on concrete sub-class factories through an abstract interface.

• This lets you organize your system around families of related products.

FishFactory

SaltwaterFishFactoryFreshwaterFishFactory

Client

Page 34: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 35: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Observer Pattern

Here is a simplified Observer pattern:

Observer Subject

attach() detach() notify()

update()

ConcreteObserver

update()

(Diagram based on p. 294 in “Design Patterns”, by Gamma et al. Addison Wesley, 1995.)

The goal of this pattern is for each (concrete) observer object to receive updates on state changes that occur within the subject object – without the subject object knowing any details about each observer. This is the ultimate in “need-to-know” programming.

Page 36: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Observer Pattern – Event Sequence

Observer Subject

attach() detach() notify()

update()

ConcreteObserver

update()

Setup:

1. Observer calls attach() on Subject, passing “this” pointer.

2. Client of Subject (or Subject itself) calls notify() at appropriate time.

3. In notify(), Subject iterates through list of observers and calls update() on each one, possibly passing state-data.

Use:

Tear-down:

4. Observer calls detach().

Page 37: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

LevelReader.h

#include <list>class Observer; // forward decl.class LevelReader{public: LevelReader(); virtual ~LevelReader(); void attach( Observer* obs ); void detach( Observer* obs ); void notify( ); double getLevel() const; // . . .public: std::list<Observer*> observer_;}

Observer Pattern – Sample Implementation

Observer.h

class LevelReader; // forward decl.class Observer{public: Observer(); virtual ~Observer(); void update(LevelReader* subject); // . . .}

Observer.cpp

#include “LevelReader.h”;

// . . .Observer::update(LevelReader* subject) { // read what you need from Subject...}

LevelReader.cpp

#include “Observer.h”;

// . . .LevelReader::attach(Observer* obs) { observers_.push_back(obs);}

LevelReader::detach(Observer* obs) { observers_.erase(obs);}

LevelReader::notify( ) { for ( /* each obs in observers_ */ ) obs->update(this);}

Page 38: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 39: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

IT Job-Market Woes

general economic worriesgeneral economic worries

less corporate $ for research and developmentless corporate $ for research and development

tight state and federal budgetstight state and federal budgets

exploitationexploitation of general economic worries of general economic worries

people at all levels are expected to “make people at all levels are expected to “make sacrifices”sacrifices”

employers are looking for bargainsemployers are looking for bargains

competition from overseas outsourcingcompetition from overseas outsourcing

insecurity over the pace of technological changeinsecurity over the pace of technological change

manager bias vs. employee training and educationmanager bias vs. employee training and education

Page 40: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

How To Keep Your Job

#1 Recognize that you may not be able to.#1 Recognize that you may not be able to.

Decisions affecting you are often made far up the Decisions affecting you are often made far up the organizational hierarchy, by people who know little to organizational hierarchy, by people who know little to nothing about you.nothing about you.

Long-term job-security is becoming increasingly rare.Long-term job-security is becoming increasingly rare.

Even the best, hardest-working, and most conscientious Even the best, hardest-working, and most conscientious employees aren’t immune.employees aren’t immune.

Page 41: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

How To Keep Your Job

#2 Make yourself indispensable.#2 Make yourself indispensable.

NotNot by being a jerk! by being a jerk! E.g., E.g., notnot by “hiding code” or by “hiding code” or otherwise hoarding vital information, by making other otherwise hoarding vital information, by making other people look bad, by stifling innovation, etc.people look bad, by stifling innovation, etc.

Become a Subject Matter Expert (SME), in one or more Become a Subject Matter Expert (SME), in one or more subjects. subjects. ShareShare what you know. Become a “ what you know. Become a “guruguru”.”.

Know a little bit about many things. Know a little bit about many things.

Take initiative.Take initiative.

Page 42: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#3 “Do what the boss says first.”#3 “Do what the boss says first.”#3 “Do what the boss says first.”#3 “Do what the boss says first.”

How To Keep Your Job

#3R #3R (Blair’s Amendment)(Blair’s Amendment)

Attend to the boss’s Attend to the boss’s concernsconcerns first. first. You You shouldshould take your supervisor’s concerns seriously take your supervisor’s concerns seriously

and give them a high priority.and give them a high priority.

However, you were hired to use your brain.However, you were hired to use your brain.

Sometimes, raising objections (politely) is good for Sometimes, raising objections (politely) is good for bothboth you and the company. you and the company.

Sometimes, it’s bad for both you and the company, but Sometimes, it’s bad for both you and the company, but it’s still the right thing to do.it’s still the right thing to do.

Page 43: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#4 Be accountable.#4 Be accountable.

How To Keep Your Job

Be able to account for how you spend your time. Be able to account for how you spend your time.

If they aren’t provided for you, ask for If they aren’t provided for you, ask for clearly defined clearly defined goalsgoals, and , and major milestonesmajor milestones against which your against which your performance will be measured.performance will be measured.

Don’t dread performance reviews; Don’t dread performance reviews; relishrelish them. These them. These are your best opportunity for “selling yourself” all over are your best opportunity for “selling yourself” all over again – and for bringing up your own concerns.again – and for bringing up your own concerns.

If you do make a mistake, If you do make a mistake, own up to itown up to it. Be honest about . Be honest about what went wrong, how you’re going to fix it, and how you’ll what went wrong, how you’re going to fix it, and how you’ll make sure it doesn’t happen again.make sure it doesn’t happen again.

Page 44: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#5 Cultivate good communication skills.#5 Cultivate good communication skills.

How To Keep Your Job

Use the correct technical terms (even when other Use the correct technical terms (even when other people laugh at you.)people laugh at you.)

Spell-check.Spell-check.

Proof-read. (Including the “To:” and “Cc:” fields!)Proof-read. (Including the “To:” and “Cc:” fields!)

If you have problems with grammar, pick up a good short If you have problems with grammar, pick up a good short book on the subject, such as “book on the subject, such as “The Elements of StyleThe Elements of Style”, by ”, by Strunk and White. Strunk and White. (Macmillan, 1999. ISBN (Macmillan, 1999. ISBN 020530902X.)020530902X.)

Be professional and polite, in your writing and in your Be professional and polite, in your writing and in your conversation. conversation.

Page 45: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#6 Be above reproach.#6 Be above reproach.

How To Keep Your Job

Be Be extremelyextremely cautious about humor. Stay far away cautious about humor. Stay far away from anything that even from anything that even hintshints of sexism, racism, of sexism, racism, ageism, or any other sort of chauvinism.ageism, or any other sort of chauvinism.

Above all, treat others with courtesy and respect. Above all, treat others with courtesy and respect. (Even when they least deserve it!)(Even when they least deserve it!)

Watch out for the big three:Watch out for the big three:- Sex- Sex- Politics- Politics- Religion- Religion

Page 46: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#7 Have a life outside of work.#7 Have a life outside of work.

How To Keep Your Job

Well-rounded people tend to be successful and resilient.Well-rounded people tend to be successful and resilient.

A few examples:A few examples:- Family- Family- Religion / Community Involvement- Religion / Community Involvement- Political Action- Political Action- Hobbies- Hobbies- Sports / Exercise- Sports / Exercise- Professional Organizations- Professional Organizations- Non-Professional Organizations- Non-Professional Organizations- Personal Studies / Personal Development- Personal Studies / Personal Development

If you define yourself by your job, losing that job will If you define yourself by your job, losing that job will be devastating. be devastating.

Page 47: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#8 Live within your means.#8 Live within your means.

How To Keep Your Job

If losing a job will cause a financial catastrophe, you If losing a job will cause a financial catastrophe, you are in a terrible negotiating position.are in a terrible negotiating position.

Money in the bank means you can be Money in the bank means you can be choosychoosy about about your next job.your next job.

Debt leads to insecurity. Debt leads to insecurity. Insecurity undermines everything else you want to Insecurity undermines everything else you want to portray and to accomplish.portray and to accomplish.

Page 48: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#9 Get Certified.#9 Get Certified.

How To Keep Your Job

Vendor certifications are sometimes a bad joke, but Vendor certifications are sometimes a bad joke, but there’s money to be had….there’s money to be had….

At least, it shows you are current. A computer science At least, it shows you are current. A computer science education from 10 years ago would probably have education from 10 years ago would probably have lacked C++, HTML, XML, etc.lacked C++, HTML, XML, etc.

If no official certification exists, you may want to go for If no official certification exists, you may want to go for outside training – community college, professional outside training – community college, professional seminar, etc. – and note the specifics on your resume.seminar, etc. – and note the specifics on your resume.

Page 49: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

#10 Stay Upbeat.#10 Stay Upbeat.

How To Keep Your Job

Your relationship with management really will suffer if Your relationship with management really will suffer if you are constantly negative.you are constantly negative.

When you are targeted by office politics, etc:When you are targeted by office politics, etc:

Don’t get mad.Don’t get mad.

Don’t get even.Don’t get even.

Just get on with itJust get on with it..

(“Foil your enemies” by simply going on to greater (“Foil your enemies” by simply going on to greater heights of personal and/or professional success. heights of personal and/or professional success. Nothing will annoy them more!)Nothing will annoy them more!)

Page 50: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

How to Keep Your Job

SummarySummary::

#1#1 Recognize that you may not be able to.Recognize that you may not be able to.#2#2 Make yourself indispensable.Make yourself indispensable.#3#3 Attend to the boss’s concerns first.Attend to the boss’s concerns first.#4#4 Be accountable.Be accountable.#5#5 Cultivate good communication skills.Cultivate good communication skills.#6#6 Be above reproach.Be above reproach.#7#7 Have a life outside of work.Have a life outside of work.#8#8 Live within your means.Live within your means.#9#9 Get CertifiedGet Certified#10#10 Stay UpbeatStay Upbeat

Page 51: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

And if you do lose your job….

Go easy on yourself.Go easy on yourself.

Go easy on the person who is firing you.Go easy on the person who is firing you.

Leave the way you entered: a class act.Leave the way you entered: a class act.

Ask for help.Ask for help.

Don’t panic.Don’t panic.

Page 52: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Blair’s Prognostications:

Don’t get tied down to one particular technology, vendor, Don’t get tied down to one particular technology, vendor, problem-domain, development style, etc.problem-domain, development style, etc.

So, …

Keep learning!Keep learning!

Help each other.Help each other.

“The buzz on the street”: Smaller, cheaper, faster. Smaller, cheaper, faster.

Heterogeneous systems.Heterogeneous systems.

Embedded systems.Embedded systems.

Systems integration.Systems integration.

Page 53: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

Agenda

1. “Design Patterns”

• Adapter

• Bridge

• Factory Method

• Observer

2. “How to Keep an Information-Technology Job”

3. Q & A

Page 54: UPE Presentation, 10/22/2003 By: Presented By: Blair Schneider McKay Consultant, Arrow Strategies, LLC. Current Project: AT&T College and University Services.

References

For more info, please feel free to contact me: [email protected]@compuserve.com

“Effective C++ and More Effective C++” (CD-ROM), by Scott Meyers. Addison Wesley, 1998. ISBN 0201310155

“Design Patterns: Elements of Reusable Object-Oriented Software” by Erich Gamma, John Vlissides, Ralph Johnson, Richard Helm, John M. Vlissides. Addison Wesley, 1994. ISBN 0201633612

“Exceptional C++”, by Herb Sutter. Addison Wesley, 1999. ISBN 0201615622

“More Exceptional C++”, by Herb Sutter. Addison Wesley, 2001. ISBN 020170434X

“C++ Gotchas: Avoiding Common Problems in Coding and Design”, by Stephen Dewhurst. Addison Wesley, 2002. ISBN 0321125185