those who know history are doomed to watch others repeat it
Post on 26-Jun-2015
1.116 Views
Preview:
DESCRIPTION
TRANSCRIPT
Those Who Know HistoryAre Doomed to Watch Others Repeat It
Who Is This Guy?
Guy Royse, Consultant
Pillar Technology
guy@guyroyse.com
@guyroyse
“History doesn’t repeat itself, but it often
rhymes”
—Mark Twain
Java is theNew COBOL
“COBOL has almost no fervent
enthusiasts. As a programming tool, it has roughly the
sex appeal of a wrench.”
Charles Petzold
CompletelyObsoleteBusinessOrientedLanguage
I had a problem that I tried tosolve with Java.
Now I have a ProblemFactory.
And anAbstractProblemFactoryManager.
ASimple Problem
Java Class Diagram
PhoneValidatorboolean validate(Phone)
AddressValidatorboolean
validate(Address)
ContactValidatorboolean
validate(Contact)
COBOL System Diagram
CONTACT-VALIDATOR
ADDRESS-VALIDATOR
PHONE-VALIDATOR
Java Data Structures
PhoneString areaCodeString exchangeString number
AddressString streetString city
String stateString zipCode
ContactString name
Address addressPhone cell
Phone home
COBOL Data Structures
01 CN-CONTACT. 05 CN-NAME PIC X(40). 05 CN-ADDRESS. 10 CN-ADDR-STREET PIC X(30). 10 CN-ADDR-CITY PIC X(20). 10 CN-ADDR-STATE PIC X(2). 10 CN-ADDR-ZIP-CODE PIC X(5). 05 CN-HOME-PHONE. 10 CN-HOME-AREA-CD PIC 9(3). 10 CN-HOME-EXCHANGE PIC 9(3). 10 CN-HOME-NUMBER PIC 9(4). 05 CN-CELL-PHONE. 10 CN-CELL-AREA-CD PIC 9(3). 10 CN-CELL-EXCHANGE PIC 9(3). 10 CN-CELL-NUMBER PIC 9(4).
01 CN-CONTACT. 05 CN-NAME PIC X(40). 05 CN-ADDRESS. 10 CN-ADDR-STREET PIC X(30). 10 CN-ADDR-CITY PIC X(20). 10 CN-ADDR-STATE PIC X(2). 10 CN-ADDR-ZIP-CODE PIC X(5). 05 CN-HOME-PHONE. 10 CN-HOME-AREA-CD PIC 9(3). 10 CN-HOME-EXCHANGE PIC 9(3). 10 CN-HOME-NUMBER PIC 9(4). 05 CN-CELL-PHONE. 10 CN-CELL-AREA-CD PIC 9(3). 10 CN-CELL-EXCHANGE PIC 9(3). 10 CN-CELL-NUMBER PIC 9(4).
public class Contact { private String name; private Phone home; private Phone cell; private Address address;
public String getName() { return name; } public void setName(String name) { this.name = name; }
... more setters and getters here ...}
public class Phone { private String areaCode; private String exchange; private String number;
... setters and getters here ...}
public class Address { private String street; private String city; private String state; private String zipCode;
... setters and getters here ...}
IDENTIFICATION DIVISION.PROGRAM-ID. CONTACT-VALIDATOR.
PROCEDURE DIVISION USING CN-IS-VALID, CN-CONTACT.
MAIN-LINE. PERFORM VALIDATE-NAME. CALL ADDRESS-VALIDATOR USING CN-ADDRESS, WS-ADDRESS-IS-VALID. CALL PHONE-VALIDATOR USING CN-HOME-PHONE, WS-HOME-PH-IS-VALID CALL PHONE-VALIDATOR USING CN-CELL-PHONE, WS-CELL-PH-IS-VALID. PERFORM DETERMINE-IF-VALID. GOBACK.
VALIDATE-NAME. MOVE ‘Y’ TO WS-NAME-IS-VALID. IF CN-NAME IS SPACES MOVE ‘N’ TO WS-NAME-IS-VALID.
DETERMINE-IF-VALID. MOVE ‘N’ to CN-IS-VALID. IF WS-NAME-IS-VALID IS ‘Y’ AND WS-HOME-PH-IS-VALID IS ‘Y’ AND WS-CELL-PH-IS-VALID IS ‘Y’ AND WS-ADDRESS-IS-VALID IS ‘Y’ MOVE ‘Y’ TO CN-IS-VALID.
public class ContactValidator {
private PhoneValidator phoneValidator = new PhoneValidator(); private AddressValidator addrValidator = new AddressValidator();
public boolean validate(Contact cntct) {
boolean valid = validateName(cntct.getName());
valid &= addrValidator.validate( cntct.getAddress());
valid &= phoneValidator.validate( cntct.getHome());
valid &= phoneValidator.validate( cntct.getCell());
return valid;
}
private void validateName(String name) { return !StringUtils.isEmpty(name); }
}
Automating the Process
Node isSingle-
Threaded
So Why Do We Keep Reinventing the Past and Calling it the Future?
Peoplein thePastWere Dumb
“I’m just a cave man. Your world frightens and confuses
me.”
“Look back over the past, with its changing empires that rose and fell,
and you can foresee the future
too.”
― Marcus Aurelius,
Meditations
“If history is deprived of the
Truth, we are left with nothing but an
idle, unprofitable tale.”
― Polybius,The Rise of the Roman Empire
Anacyclosis
Basic Cycle
How Projects Run
How We Code
How We Design Applications
The 40s and 50s
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
UNIVAC
Z3Mark 1
The 60s and 70s
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
The Late 70s
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
Early PCs
The 80s
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
PCs
Early PCs
The 90s
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
PCs
Early PCs
ClientServer
Browser
Internet
In The Year 2000
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
PCs
Early PCs
ClientServer
Browser
Mobile
Internet
AJAX
2010s
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
PCs
Early PCs
ClientServer
Browser
Mobile
Internet
HTML5
Cloud
PiAJAX
Computing Timeline40s & 50s 60s & 70s 80s 90s 2000s 2010s ???
Server-side
Client-side
ENIAC
Mainframes
TeletypesTerminals
CICS
UNIVAC
Z3Mark 1
UNIX
PCs
Early PCs
ClientServer
Browser
Mobile
Internet
HTML5
Cloud
Pi
?
AJAX
“It is not worthwhile to try to keep history from repeating itself, for man's character will
always make the preventing of the
repetitions impossible.”
— Mark Twain
Guy Royse, Consultant
Pillar Technology
guy@guyroyse.com
@guyroyse
top related