NDC 2011 - The FLUID Principles
-
Upload
anoras -
Category
Technology
-
view
4.643 -
download
8
description
Transcript of NDC 2011 - The FLUID Principles
![Page 1: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/1.jpg)
ndc 2011
![Page 2: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/2.jpg)
![Page 3: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/3.jpg)
FLUIDThe
PrinciplesKevlin HenneyAnders Norås
![Page 4: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/4.jpg)
FLUID
SOLIDcontrasts with
![Page 5: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/5.jpg)
![Page 6: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/6.jpg)
SOLID
![Page 7: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/7.jpg)
SOL
ingle Responsibility Principle
pen / Closed Principle
iskov’s Substitution Principle
nterface Segregation Principle
ependency Inversion Principle
ID
![Page 8: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/8.jpg)
Bob might not be your uncle
By A. NORÅS &K. HENNEY
Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud.
Neque pecun modut nequeConsectetuer arcu ipsum ornare pellentesque vehicula, in vehicula diam, ornare magna erat felis wisi a risus. Justo fermentum id. Malesuada eleifend, tortor molestie, a fusce a vel et. Mauris at suspendisse, neque aliquam faucibus adipiscing, vivamus in. Wisi mattis leo suscipit nec amet, nisl fermentum tempor ac a, augue in eleifend in venenatis, cras sit id in vestibulum felis. Molestie ornare amet vel id fusce, rem volutpat platea. Magnis vel, lacinia nisl, vel nostra nunc eleifend arcu leo, in dignissim lorem vivamus laoreet.
Donec arcu risus diam amet sit. Congue tortor cursus risus vestibulum commodo nisl, luctus augue amet quis aenean odio etiammaecenas sit, donec velit iusto, morbi felis elit et nibh. Vestibulum volutpat dui lacus consectetuer ut, mauris at etiam suspendisse, eu wisi rhoncus eget nibh velit, eget posuere sem in a sit.
Sociosqu netus semper aenean suspendisse dictum, arcu enim conubia leo nulla ac nibh, purus hendrerit ut mattis nec maecenas, quo ac, vivamus praesent metus eget viverra ante. Natoque placerat sed sit hendrerit, dapibus eleifend velit molestiae leo a, ut lorem sit et lacus aliquam. Sodales nulla erat et luctus faucibus aperiam sapien. Leo inceptos augue nec pulvinar rutrum aliquam mauris, wisi hasellus fames ac, commodo eligendi dictumst, dapibus morbi auctor.
Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud.
Etiam sit amet est
The Software Dev Times“ALL THE NEWS THAT’S FIT TO DEPLOY” LATE EDITION
VOL XI...NO 12,345 OSLO, WEDNESDAY, JUNE 8, 2011 FREE AS IN BEER
SHOCK-SOLID!MYSTERIOUS SOFTWARE CRAFTSMAN
COINED THE SOLID ACRONYM!
NO COMMENT. The software craftsman claimed to have discovered that a set of principles could be abbreviated “SOLID”, declined to comment on the matter.
Bob might not be your uncle
By A. NORÅS &K. HENNEY
Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud.
Neque pecun modut nequeConsectetuer arcu ipsum ornare pellentesque vehicula, in vehicula diam, ornare magna erat felis wisi a risus. Justo fermentum id. Malesuada eleifend, tortor molestie, a fusce a vel et. Mauris at suspendisse, neque aliquam faucibus adipiscing, vivamus in. Wisi mattis leo suscipit nec amet, nisl fermentum tempor ac a, augue in eleifend in venenatis, cras sit id in vestibulum felis. Molestie ornare amet vel id fusce, rem volutpat platea. Magnis vel, lacinia nisl, vel nostra nunc eleifend arcu leo, in dignissim lorem vivamus laoreet.
Donec arcu risus diam amet sit. Congue tortor cursus risus vestibulum commodo nisl, luctus augue amet quis aenean odio etiammaecenas sit, donec velit iusto, morbi felis elit et nibh. Vestibulum volutpat dui lacus consectetuer ut, mauris at etiam suspendisse, eu wisi rhoncus eget nibh velit, eget posuere sem in a sit.
Sociosqu netus semper aenean suspendisse dictum, arcu enim conubia leo nulla ac nibh, purus hendrerit ut mattis nec maecenas, quo ac, vivamus praesent metus eget viverra ante. Natoque placerat sed sit hendrerit, dapibus eleifend velit molestiae leo a, ut lorem sit et lacus aliquam. Sodales nulla erat et luctus faucibus aperiam sapien. Leo inceptos augue nec pulvinar rutrum aliquam mauris, wisi hasellus fames ac, commodo eligendi dictumst, dapibus morbi auctor.
Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud.
Etiam sit amet est
The Software Dev Times“ALL THE NEWS THAT’S FIT TO DEPLOY” LATE EDITION
VOL XI...NO 12,345 OSLO, WEDNESDAY, JUNE 8, 2011 FREE AS IN BEER
SHOCK-SOLID!MYSTERIOUS SOFTWARE CRAFTSMAN
COINED THE SOLID ACRONYM!
NO COMMENT. The software craftsman claimed to have discovered that a set of principles could be abbreviated “SOLID”, declined to comment on the matter.
![Page 9: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/9.jpg)
![Page 10: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/10.jpg)
![Page 11: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/11.jpg)
eBristol
Dictionaryof
ConciseEnglish
![Page 12: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/12.jpg)
prin·ci·ple /ˈprinsəpəl/ Noun
1. a fundamental truth or proposit ion that serves as the foundation for a system of belief or behaviour or for a chain of reasoning.2. morally correct behaviour and attitudes.3. a general scienti"c theorem or law that has n u m e r o u s s p e c i a l applications across a wide "eld.
4. a natural law forming t h e b a s i s f o r t h e construction or working of a machine.
para·skevi·de·katri·a·pho·bia /ˈpærəskevidekaˈtriəˈfōbēə/ Adjective, Noun
1. fear of Friday the 13th. Etymology: e word was devised by Dr. Donald Dossey who told his patients that "when you learn to pronounce it, you're cured.
![Page 13: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/13.jpg)
![Page 14: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/14.jpg)
FLUIDThe
PrinciplesKevlin HenneyAnders Norås
![Page 15: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/15.jpg)
FLUIDThe
Kevlin HenneyAnders Norås
Guidelines
![Page 16: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/16.jpg)
![Page 17: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/17.jpg)
F L U I DWhat are the
Guidelines?
![Page 18: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/18.jpg)
F
L
U
I
D
![Page 19: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/19.jpg)
F
L
U
I
D
![Page 20: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/20.jpg)
![Page 21: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/21.jpg)
![Page 22: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/22.jpg)
Functional
![Page 23: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/23.jpg)
public class HeatingSystem { public void turnOn() ... public void turnOff() ... ...}
public class Timer { public Timer(TimeOfDay toExpire, Runnable toDo) ... public void run() ... public void cancel() ... ...}
Java
![Page 24: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/24.jpg)
public class TurnOn implements Runnable { private HeatingSystem toTurnOn; public TurnOn(HeatingSystem toRun) { toTurnOn = toRun; } public void run() { toTurnOn.turnOn(); }}public class TurnOff implements Runnable { private HeatingSystem toTurnOff; public TurnOff(HeatingSystem toRun) { toTurnOff = toRun; } public void run() { toTurnOff.turnOff(); }}
Java
![Page 25: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/25.jpg)
Timer turningOn = new Timer(timeOn, new TurnOn(heatingSystem));Timer turningOff = new Timer(timeOff, new TurnOff(heatingSystem));
Java
![Page 26: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/26.jpg)
Timer turningOn = new Timer( timeToTurnOn, new Runnable() { public void run() { heatingSystem.turnOn(); } });Timer turningOff = new Timer( timeToTurnOff, new Runnable() { public void run() { heatingSystem.turnOff(); } });
Java
![Page 27: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/27.jpg)
void turnOn(void * toTurnOn){ static_cast<HeatingSystem *>(toTurnOn)->turnOn();}void turnOff(void * toTurnOff){ static_cast<HeatingSystem *>(toTurnOff)->turnOff();}
C++
![Page 28: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/28.jpg)
Timer turningOn(timeOn, &heatingSystem, turnOn);Timer turningOff(timeOff, &heatingSystem, turnOff);
C++
![Page 29: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/29.jpg)
class Timer{ Timer(TimeOfDay toExpire, function<void()> toDo); void run(); void cancel(); ...};
C++
![Page 30: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/30.jpg)
Timer turningOn( timeOn, bind( &HeatingSystem::turnOn, &heatingSystem));Timer turningOff( timeOff, bind( &HeatingSystem::turnOff, &heatingSystem));
C++
![Page 31: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/31.jpg)
public class Timer{ public Timer( TimeOfDay toExpire, Action toDo) ... public void Run() ... public void Cancel() ... ...}
C#
![Page 32: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/32.jpg)
Timer turningOn = new Timer( timeOn, () => heatingSystem.TurnOn() );Timer turningOff = new Timer( timeOff, () => heatingSystem.TurnOff() );
C#
![Page 33: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/33.jpg)
Timer turningOn = new Timer( timeOn, heatingSystem.TurnOn );Timer turningOff = new Timer( timeOff, heatingSystem.TurnOff );
C#
![Page 34: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/34.jpg)
![Page 35: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/35.jpg)
![Page 36: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/36.jpg)
![Page 37: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/37.jpg)
F
L
U
I
D
unctional
![Page 38: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/38.jpg)
F
L
U
I
D
unctional
![Page 39: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/39.jpg)
![Page 40: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/40.jpg)
![Page 41: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/41.jpg)
Loose
![Page 42: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/42.jpg)
![Page 43: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/43.jpg)
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.
“
•Allan Kay
![Page 44: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/44.jpg)
#include <windows.h> #include <stdio.h> typedef int (__cdecl *MYPROC)(LPWSTR); VOID main(VOID) { HINSTANCE hinstLib; MYPROC ProcAdd; BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; hinstLib = LoadLibrary(TEXT("echo.dll")); if (hinstLib != NULL) { ProcAdd = (MYPROC) GetProcAddress(hinstLib, "echo"); if (NULL != ProcAdd) { fRunTimeLinkSuccess = TRUE; (ProcAdd) (L"Hello my world!\n"); } fFreeResult = FreeLibrary(hinstLib); } if (!fRunTimeLinkSuccess) printf("Hello everybody's world!\n"); }
C
![Page 45: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/45.jpg)
class HeatingSystem { def turnOn() { ... } def turnOff() { ... }}def heater = new HeatingSystem()def timer = new Timer()def action = "turnOn"timer.runAfter(1000) { heater."$action"()}
Groovy
![Page 46: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/46.jpg)
class DiyStore{ private $_bucket; public function getPaintBucket() { if ($this->_bucket === null) { $this->_bucket = $this->fillPaintBucket(); } return $this->_bucket; } private function fillPaintBucket() { // ... }}
PHP
![Page 47: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/47.jpg)
![Page 48: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/48.jpg)
NullObject.new().say().hello().to().any().method_call().you().like()
Ruby
![Page 49: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/49.jpg)
FLUIDThe
PrinciplesKevlin HenneyAnders Norås
![Page 50: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/50.jpg)
FLUIDThe
Kevlin HenneyAnders Norås
Suggestions
![Page 51: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/51.jpg)
![Page 52: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/52.jpg)
F
U
L
I
D
unctional
oose
![Page 53: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/53.jpg)
U
F
L
I
D
unctional
oose
![Page 54: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/54.jpg)
![Page 55: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/55.jpg)
Unit Testable
![Page 56: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/56.jpg)
![Page 57: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/57.jpg)
function GetNextFriday13th($from) { [DateTime[]] $friday13ths = &{ foreach($i in 1..500) { $from = $from.AddDays(1) $from } } | ?{ $_.DayOfWeek -eq [DayOfWeek]::Friday -and $_.Day -eq 13 } return $friday13ths[0]}
PowerShell
![Page 58: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/58.jpg)
[DateTime[][]] $inputsWithExpectations = ("2011-01-01", "2011-05-13"), ("2011-05-13", "2012-01-13"), ("2007-04-01", "2007-04-13"), ("2007-04-12", "2007-04-13"), ("2007-04-13", "2007-07-13"), ("2012-01-01", "2012-01-13"), ("2012-01-13", "2012-04-13"), ("2012-04-13", "2012-07-13"), ("2001-07-13", "2002-09-13")
PowerShell
![Page 59: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/59.jpg)
$inputsWithExpectations | ?{ [String] $actual = GetNextFriday13th($_[0]) [String] $expected = $_[1] $actual -ne $expected}
PowerShell
![Page 60: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/60.jpg)
![Page 61: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/61.jpg)
F
L
U
I
D
unctional
oose
nit Testable
![Page 62: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/62.jpg)
F
L
U
I
D
unctional
oose
nit Testable
![Page 63: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/63.jpg)
![Page 64: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/64.jpg)
![Page 65: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/65.jpg)
Introspective
![Page 66: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/66.jpg)
![Page 67: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/67.jpg)
(define (eval exp env) (cond ((self-evaluating? exp) exp) ((variable? exp) (lookup-variable-value exp env)) ((quoted? exp) (text-of-quotation exp)) ((assignment? exp) (eval-assignment exp env)) ((definition? exp) (eval-definition exp env)) ((if? exp) (eval-if exp env)) ((lambda? exp)) (make-procedure (lambda-parameters exp) (lambda-body exp) env)) ((begin? exp) (eval-sequence (begin-actions exp) env)) ((cond? exp) (eval (cond->if exp) env)) ((application? exp) (apply (eval (operator exp) env) (list-of-values (operands exp) env))) (else (error "Unknown expression type -EVAL" exp))))
Scheme
![Page 68: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/68.jpg)
function Shoebox() { var things = ["Nike 42", "Adidas 41", "Adidas 43", "Paul Smith 41"]; def(this, "find", function(brand) { var result = []; for (var i=0; i<things.length; i++) { if (things[i].indexOf(brand) !== -1) result.push(things[i]); } return result; }); def(this, "find", function(brand,size) { var result = []; for (var i=0; i<things.length; i++) { if (things[i].indexOf(brand) !== -1 || parseInt(things[i].match(/\d+/),10) === size) result.push(things[i]); } return result; });}
function def(obj, name, fn) { var implFn = obj[name]; obj[name]=function() { if (fn.length === arguments.length) return fn.apply(this,arguments); else if (typeof implFn === "function") return implFn.apply(this,arguments); };};
JavaScript
![Page 69: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/69.jpg)
Public Class Book <Key> _ Public Property ISBN() As String ' ... End Property
<StringLength(256)> _ Public Property Title() As String ' ... End Property
Public Property AuthorSSN() As String ' ... End Property
<RelatedTo(RelatedProperty := Books, Key := AuthorSSN, RelatedKey := SSN)> _ Public Property Author() As Person ' ... End PropertyEnd Class
Visual Basic
![Page 70: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/70.jpg)
![Page 71: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/71.jpg)
F
L
U
I
D
unctional
oose
nit Testable
ntrospective
![Page 72: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/72.jpg)
F
L
U
I
D
unctional
oose
nit Testable
ntrospective
![Page 73: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/73.jpg)
![Page 74: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/74.jpg)
![Page 75: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/75.jpg)
‘Dempotent
![Page 76: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/76.jpg)
![Page 77: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/77.jpg)
![Page 78: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/78.jpg)
Asking a question s h o u l d n o t c h a n g e t h e answer.
“•Betrand Meyer
![Page 79: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/79.jpg)
Asking a question s h o u l d n o t c h a n g e t h e answer.
“•Betrand Meyer
, and nor should asking it twice!
Retweeted by @kevlinhenney
![Page 80: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/80.jpg)
(1 to 10).foldLeft(0)(_ + _)Scala
![Page 81: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/81.jpg)
![Page 82: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/82.jpg)
F
L
U
I
D
unctional
oose
nit Testable
ntrospective
dempotent‘
![Page 83: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/83.jpg)
![Page 84: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/84.jpg)
![Page 85: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/85.jpg)
![Page 86: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/86.jpg)
![Page 87: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/87.jpg)
![Page 88: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/88.jpg)
e venerable master Qc Na was walking with his student, Anton.Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing — is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil — objects are merely a poor man's closures." Chastised, Anton took his leave from his master and returned to his cell, intent on studying closures. He carefully read the entire "Lambda: e Ultimate..." series of papers and its cousins, and implemented a small Scheme interpreter with a closure-based object system. He learned much, and looked forward to informing his master of his progress. On his next walk with Qc Na, Anton attempted to impress his master by saying "Master, I have diligently studied the matter, and now understand that objects are truly a poor man's closures." Qc Na responded by hitting Anton with his stick, saying "When will you learn? Closures are a poor man's object." At that moment, Anton became enlightened.
http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html
![Page 89: NDC 2011 - The FLUID Principles](https://reader030.fdocuments.us/reader030/viewer/2022012401/5482b9c7b4af9f730d8b48b6/html5/thumbnails/89.jpg)
@anoras@kevlinhenney