Daniel Friedman: A Poorman's 'Roll Your Own' Object System
started 3/2/2002; 12:53:10 PM - last post 5/22/2002; 10:23:32 AM
|
|
Ehud Lamm - Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/2/2002; 12:53:10 PM (reads: 2916, responses: 7)
|
|
Daniel Friedman: A Poorman's 'Roll Your Own' Object System |
Implementing OOP in Scheme.
The exposition can perhaps be made clearer, but the ideas are worth thinking about.
In a sense this is just another prototype implementation of classes and inheritance, but the construction is both pretty short and self contained.
Posted to OOP by Ehud Lamm on 3/2/02; 12:54:28 PM
|
|
|
|
Patrick Logan - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/2/2002; 5:14:16 PM (reads: 1837, responses: 0)
|
|
Looking at these 15 pages I decided to document how simple objects are in a functional language like Lisp.
In 20 lines of code I implement message passing, inheritance, and reflection.
|
|
Luke Gorrie - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/2/2002; 6:32:08 PM (reads: 1823, responses: 0)
|
|
Anyone can write a toy object system, it's writing a good program based on the toy object system that's the hard part ;-)
|
|
Patrick Logan - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/2/2002; 8:08:46 PM (reads: 1837, responses: 0)
|
|
The challenge is to write the smallest object system possible that exhibits:
(1) Polymorphic message sends.
(2) Inheritance.
(3) Reflection.
Of course, this will be a "toy". But "playing with toys" is how we learn.
Have fun! 8^)
|
|
Chris Rathman - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/2/2002; 11:29:50 PM (reads: 1818, responses: 0)
|
|
Having written inheritance and polymorphic dispatch in a number of different languages, I think the more difficult task is the question of how easy it is to implement the stand GOF design patterns in these languages. A better gauage is how easy (or hard) it is to do the standard design patterns in your language.
The 24 patterns are not the be-all of OOP, but they do give the better indication of depth of OOP languages - the weaknesses and strengths.
|
|
Patrick Logan - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/3/2002; 8:27:54 AM (reads: 1804, responses: 0)
|
|
I agree with Chris. I think those patterns are a more difficult task, and they are a better gauge for building real applications.
If you are looking to boil OOP down to its bare essence, though, I think it is useful to see a few very small implementations.
Both of these views of OOP can make us better programmers.
|
|
Ehud Lamm - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
3/4/2002; 7:53:58 AM (reads: 1743, responses: 0)
|
|
By the way, recall that not all patterns are really required in all languages.
|
|
Ehud Lamm - Re: Daniel Friedman: A Poorman's 'Roll Your Own' Object System
5/22/2002; 10:23:32 AM (reads: 1515, responses: 0)
|
|
|
|
|