[#356209] Workaround for "conflict" between ARGV and gets? — RichardOnRails <RichardDummyMailbox58407@...>

gets looks to ARGV, if populated, for its source of data. That is its

9 messages 2010/02/01

[#356306] UTF8 hell — Xavier No謖le <xavier.noelle@...>

Hello,

15 messages 2010/02/02
[#356309] Re: [ENCODING] UTF8 hell — David Palm <dvdplm@...> 2010/02/02

> I fetch rows from an UTF8 database and try to work with the string. To

[#356317] Why Ruby? — Jim Maher <jdmaher@...>

I've asked several friends and associates (application developers) what

52 messages 2010/02/02

[#356433] Hashes versus Arrays — Jerome David Sallinger <imran.nazir@...>

Hello,

11 messages 2010/02/03

[#356439] rdoc_osx_dictionary 1.2.0 Released — Ryan Davis <ryand-ruby@...>

rdoc_osx_dictionary version 1.2.0 has been released!

14 messages 2010/02/03

[#356451] Error: uninitialized constant Mysql::Protocol::UNIXSocket — Shahab Qadeer <shahab_qadeer@...>

/!\ FAILSAFE /!\ Wed Feb 03 23:02:50 +0500 2010

15 messages 2010/02/03

[#356459] hooking subscript operations in a hash — Ralph Shnelvar <ralphs@...32.com>

In order to help debug something, I'd like to hook the hash subscript operation.

17 messages 2010/02/04
[#356461] Re: hooking subscript operations in a hash — Rick DeNatale <rick.denatale@...> 2010/02/04

On Wed, Feb 3, 2010 at 9:38 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:

[#356462] Re: hooking subscript operations in a hash — Ralph Shnelvar <ralphs@...32.com> 2010/02/04

RD> On Wed, Feb 3, 2010 at 9:38 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:

[#356489] Some noob questions — John Ydil <john.gendrot@...>

Hello Ruby friends!

29 messages 2010/02/04
[#356494] Re: Some noob questions — Robert Klemme <shortcutter@...> 2010/02/04

On 02/04/2010 11:58 AM, John Ydil wrote:

[#356568] Re: Some noob questions — Albert Schlef <albertschlef@...> 2010/02/04

Robert Klemme wrote:

[#356605] Re: Some noob questions — Robert Klemme <shortcutter@...> 2010/02/05

On 05.02.2010 00:10, Albert Schlef wrote:

[#356624] Re: Some noob questions — Albert Schlef <albertschlef@...> 2010/02/05

Robert Klemme wrote:

[#356626] Re: Some noob questions — Robert Klemme <shortcutter@...> 2010/02/05

On 02/05/2010 12:50 PM, Albert Schlef wrote:

[#356628] Re: Some noob questions — Albert Schlef <albertschlef@...> 2010/02/05

Robert Klemme wrote:

[#356665] Re: Some noob questions — Robert Klemme <shortcutter@...> 2010/02/05

On 02/05/2010 02:01 PM, Albert Schlef wrote:

[#356811] Re: Some noob questions — Aldric Giacomoni <aldric@...> 2010/02/08

Robert Klemme wrote:

[#356814] Re: Some noob questions — Robert Klemme <shortcutter@...> 2010/02/08

2010/2/8 Aldric Giacomoni <aldric@trevoke.net>:

[#356531] Finding duplicate records before creating using FasterCSV — John Mcleod <john.mcleod@...>

Hello all,

11 messages 2010/02/04

[#356563] Can Ruby Do This? — Mr Bubb <jcabraham@...>

In Perl, you can create a hash of arbitrary depth like so:

14 messages 2010/02/04

[#356685] Google AI Challenge at U of Waterloo — Forthminder <mentifex@...>

Contest runs from 4 February to 26 February 2010.

11 messages 2010/02/06

[#356716] match/scan does not return multiple matches — Michal Suchanek <hramrach@...>

Hello

12 messages 2010/02/06

[#356744] Honest opinion needed... — Schala Zeal <schalaalexiazeal@...>

I've been trying to find a scripting language to integrate into a game

15 messages 2010/02/07

[#356769] C embed assistance — Schala Zeal <schalaalexiazeal@...>

I was wondering if there was a site with reliable documentation covering

15 messages 2010/02/07

[#356792] Why no ++ and --? — Sonja Elen Kisa <sonja@...>

"foo += 1" somehow seems less elegant or pretty as "foo++".

27 messages 2010/02/08

[#356882] "Code must be Chunkable" — Intransition <transfire@...>

I watched Part 1 of this great lecture, and I just had to share:

46 messages 2010/02/08
[#356943] Re: "Code must be Chunkable" — Brian Candler <b.candler@...> 2010/02/09

Thomas Sawyer wrote:

[#357074] Re: "Code must be Chunkable" — Intransition <transfire@...> 2010/02/11

On Feb 9, 11:40 am, Brian Candler <b.cand...@pobox.com> wrote:

[#356944] Need Code to Create Directory Picking Dialog Box — Alex DeCaria <alex.decaria@...>

I have a Ruby program and want to be able to pick a directory using a

14 messages 2010/02/09

[#357030] Exit method? — Charlie Ca <artemisc360@...>

Hello World,

23 messages 2010/02/10
[#357033] Re: Exit method? — Marnen Laibow-Koser <marnen@...> 2010/02/10

Charlie Ca wrote:

[#357103] Can SWIN CommonDialog.openFilename() select multiple files? — Alex DeCaria <alex.decaria@...>

12 messages 2010/02/11

[#357170] how to detect used protocol (SOAP, JSON, XML etc.) — jeljer te Wies <jeljer@...>

Hi guys!.

15 messages 2010/02/12

[#357187] Is there a way to get a method to always run at the end of any descendent's initialize method? — Xeno Campanoli <xeno.campanoli@...>

I have an initialize method I want to run at the end of any daughter or

11 messages 2010/02/12

[#357249] Generating all possible combinations of a 5 digit pattern. — Zach Bartels <no@...>

This is probably childs play for most of you.. But I lack the

17 messages 2010/02/13

[#357446] Dia 1.1 released! — Robert Gleeson <rob@...>

Hey

17 messages 2010/02/16
[#357451] Re: Dia 1.1 released! — Daniel Berger <djberg96@...> 2010/02/16

[#357453] Re: Dia 1.1 released! — Robert Gleeson <rob@...> 2010/02/16

Dan --

[#357909] Re: Dia 1.1 released! — Robert Gleeson <rob@...> 2010/02/23

I'm just leaving an update:

[#357485] Tk on Windows and Mac OS X 10.6 — Eric Christopherson <echristopherson@...>

Is it possible to install Ruby Tk bindings on Windows with

37 messages 2010/02/16
[#357491] Re: Tk on Windows and Mac OS X 10.6 — Albert Schlef <albertschlef@...> 2010/02/16

Eric Christopherson wrote:

[#357492] Re: Tk on Windows and Mac OS X 10.6 — Eric Christopherson <echristopherson@...> 2010/02/17

On Tue, Feb 16, 2010 at 5:57 PM, Albert Schlef <albertschlef@gmail.com> wro=

[#357496] Re: Tk on Windows and Mac OS X 10.6 — Albert Schlef <albertschlef@...> 2010/02/17

Eric Christopherson wrote:

[#357548] Where is Ruby 1.9 'TK' library? — Alex DeCaria <alex.decaria@...>

Just installed Ruby 1.9 and tried to run one of my TK applications that

31 messages 2010/02/17
[#357559] Re: Where is Ruby 1.9 'TK' library? — Luis Lavena <luislavena@...> 2010/02/17

On Feb 17, 7:36=A0pm, Alex DeCaria <alex.deca...@millersville.edu>

[#357567] Re: Where is Ruby 1.9 'TK' library? — Eric Christopherson <echristopherson@...> 2010/02/17

On Wed, Feb 17, 2010 at 3:10 PM, Luis Lavena <luislavena@gmail.com> wrote:

[#357570] Re: Where is Ruby 1.9 'TK' library? — Roger Pack <rogerpack2005@...> 2010/02/17

> Luis, is it possible at all to *add* Tk bindings to a copy of Ruby

[#357572] Re: Where is Ruby 1.9 'TK' library? — Eric Christopherson <echristopherson@...> 2010/02/18

On Wed, Feb 17, 2010 at 5:40 PM, Roger Pack <rogerpack2005@gmail.com> wrote:

[#357577] Re: Where is Ruby 1.9 'TK' library? — Alex DeCaria <alex.decaria@...> 2010/02/18

Roger Pack wrote:

[#357583] Re: Where is Ruby 1.9 'TK' library? — Roger Pack <rogerpack2005@...> 2010/02/18

[#358598] Re: Where is Ruby 1.9 'TK' library? — Alex DeCaria <alex.decaria@...> 2010/03/05

Roger Pack wrote:

[#357617] strings combine — Roger Pack <rogerpack2005@...>

Shouldn't the following be a syntax error?

24 messages 2010/02/18
[#357618] Re: strings combine — Gary Wright <gwtmp01@...> 2010/02/18

[#357637] Re: strings combine — Roger Pack <rogerpack2005@...> 2010/02/18

[#357658] Re: strings combine — Robert Klemme <shortcutter@...> 2010/02/19

On 02/18/2010 11:32 PM, Roger Pack wrote:

[#357681] Re: strings combine — Raul Jara <raul.c.jara@...> 2010/02/19

This doesn't work if you assign the strings to variables though:

[#357683] Re: strings combine — Robert Klemme <shortcutter@...> 2010/02/19

2010/2/19 Raul Jara <raul.c.jara@gmail.com>:

[#357697] Re: strings combine — Raul Jara <raul.c.jara@...> 2010/02/19

Robert Klemme wrote:

[#357707] Re: strings combine — Robert Klemme <shortcutter@...> 2010/02/19

On 19.02.2010 17:40, Raul Jara wrote:

[#357716] Re: strings combine — Raul Jara <raul.c.jara@...> 2010/02/19

> Robert@babelfish ~

[#357621] RTranslate Gem (Open-URI) and Encoding — The Chromag <brent@...>

I'm using the rtranslate gem (sishen-rtranslate) to handle translating

12 messages 2010/02/18

[#357622] Ruby conditionals subtlety? — Farhad Farzaneh <ff@...>

Hi,

18 messages 2010/02/18
[#357630] Re: Ruby conditionals subtlety? — Ryan Davis <ryand-ruby@...> 2010/02/18

[#357632] Re: Ruby conditionals subtlety? — Farhad Farzaneh <ff@...> 2010/02/18

Ryan Davis wrote:

[#357641] Re: Ruby conditionals subtlety? — Ryan Davis <ryand-ruby@...> 2010/02/18

[#357642] Re: Ruby conditionals subtlety? — Farhad Farzaneh <ff@...> 2010/02/19

Ryan Davis wrote:

[#357678] Get Goolge Result — Sajjad Seyyed <treep_ir@...>

Hi

15 messages 2010/02/19

[#357878] Speed sprint — Benedikt Müller <benemue@...>

Hi

23 messages 2010/02/22

[#357899] Test::Unit Newbie Question regarding loops — Yotta Meter <spam@...>

With the following example:

13 messages 2010/02/23
[#357936] Re: Test::Unit Newbie Question regarding loops — Brian Candler <b.candler@...> 2010/02/23

Yotta Meter wrote:

[#357939] Re: Test::Unit Newbie Question regarding loops — Yotta Meter <spam@...> 2010/02/23

This is really the great idea I was looking for, thanks. Obviously I'm

[#357940] How do I set the encoding on a regexp ? — Perry Smith <pedzsan@...>

Title pretty much says it all. Here is a small sample program:

20 messages 2010/02/23
[#358010] Re: How do I set the encoding on a regexp ? — David Springer <dnspringer@...> 2010/02/24

Perry,

[#358060] Array index question — John Smith <ks1911shooter@...>

Question about an array. Say I have the following array...

12 messages 2010/02/25

[#358108] Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...>

Hi All,

35 messages 2010/02/26
[#358114] Re: Installing Pg gem for PostGreSQL 8.4 — Shashank Tiwari <tshanky@...> 2010/02/26

Are you installing this on a mac, windows or a linux environment? You may

[#358116] Re: Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...> 2010/02/26

Shashank Tiwari wrote:

[#358256] Re: Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...> 2010/03/01

Saeed Bhuta wrote:

[#358269] Re: Installing Pg gem for PostGreSQL 8.4 — Reid Thompson <reid.thompson@...> 2010/03/01

On Mon, 2010-03-01 at 17:56 +0900, Saeed Bhuta wrote:

[#358278] Re: Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...> 2010/03/01

Here is the result of the '$ dpkg --get-selections' command;

[#358288] Re: Installing Pg gem for PostGreSQL 8.4 — Reid Thompson <reid.thompson@...> 2010/03/01

On Mon, 2010-03-01 at 23:19 +0900, Saeed Bhuta wrote:

[#358289] Re: Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...> 2010/03/01

Reid Thompson wrote:

[#358330] Re: Installing Pg gem for PostGreSQL 8.4 — Reid Thompson <reid.thompson@...> 2010/03/01

On Tue, 2010-03-02 at 00:58 +0900, Saeed Bhuta wrote:

[#358370] Re: Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...> 2010/03/02

Reid Thompson wrote:

[#358386] Re: Installing Pg gem for PostGreSQL 8.4 — Reid Thompson <reid.thompson@...> 2010/03/02

On Tue, 2010-03-02 at 17:24 +0900, Saeed Bhuta wrote:

[#358387] Re: Installing Pg gem for PostGreSQL 8.4 — Saeed Bhuta <saeed.bhuta@...> 2010/03/02

Reid Thompson wrote:

[#358399] Re: Installing Pg gem for PostGreSQL 8.4 — Reid Thompson <reid.thompson@...> 2010/03/02

On Tue, 2010-03-02 at 23:09 +0900, Saeed Bhuta wrote:

[#358402] Re: Installing Pg gem for PostGreSQL 8.4 — Reid Thompson <reid.thompson@...> 2010/03/02

On Tue, 2010-03-02 at 11:23 -0500, Reid Thompson wrote:

[#358117] Music Theory (#229) — Daniel Moore <yahivin@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

29 messages 2010/02/26
[#358430] Re: Music Theory (#229) — Ben Rho <dearbenj@...> 2010/03/03

Daniel X Moore wrote:

[#358444] Re: Music Theory (#229) — Daniel Moore <yahivin@...> 2010/03/03

Wow, this is some great discussion! Both piano and guitar chords are

[#358467] Re: Music Theory (#229) — Ben Rho <dearbenj@...> 2010/03/03

Daniel X Moore wrote:

[#358141] running a file — John Pasqa <jasello098@...>

ok, i'm writing a ruby program that interprets some text and does stuff

14 messages 2010/02/27

[#358204] Shoes? — Kurtis Rainbolt-greene <thinkwritemute@...>

Ok, so I'm getting back into GUI development and I want to use Ruby.

23 messages 2010/02/28
[#358205] Re: Shoes? — Howard Roberts <howardroberts@...> 2010/02/28

Kurtis Rainbolt-greene wrote:

[#358208] Re: Shoes? — Kurtis Rainbolt-greene <thinkwritemute@...> 2010/02/28

Howard Roberts wrote:

[#358228] Re: Shoes? — Ryan Davis <ryand-ruby@...> 2010/02/28

Re: "Code must be Chunkable"

From: James Coplien <jcoplien@...>
Date: 2010-02-17 17:33:53 UTC
List: ruby-talk #357539
Thomas Sawyer wrote:

> Hi James,
> 
> Honestly, James, I didn't even think about contacting you --I didn't
> even suspect I'd be getting this deep into a conversation about it.

The I'm happy to offer a revelation in your mindset. And welcome to the 
Internet world.


> However, while your example gave me at
> least something to go on, the presentation as a whole left me more
> confused and thus less enthusiastic about the whole DCI idea.

That is in fact probably good! That is what should be happening as you 
make a paradigm shift. Expect to be confused and surprised.

I'll come back to this notion throughout the mail.

My example didn't only extemporize on Trygve's, but went into some new 
territory. And I think some people got lost there.

I know this sounds like rationalization, but in fact, most of my 
teaching the past thirty years has involved some kind of paradigm shift, 
and I am attentive to the need of this puzzlement. If you read "Zen and 
the art of motorcycle maintenance," Pirsig calls it "stuckness." 
Learning new things is not always a linear process.


> I apologize for compacting this opinion into the one word "awful", I
> suppose that is too disparaging a term, and for that I apologize. So
> please accept this explanation in it's place and take it for what it's
> worth.

You can call me whatever you want to my face, and in this discussion, I 
hope you do, you ignoramous :-) I am more hurt by the fact that you 
might have seized an opportunity for dialog and learning but instead 
cast aspersions mumbling in a corner somewhere. I feel hurt on behalf of 
the community. We need your criticism — but in dialog.


>> Words mean things, and use case is not just Swedish for scenario.
> 
> The definition seems fine. I just don't see why logging-in can't be
> viewed as a goal in itself.

As most use case experts would describe it, you don't go home at the end 
of the day and tell your daughter, "Guess what I did today! I got logged 
in!" Logging in isn't essential to the value chain. The goals in 
goal-driven use cases drive towards such goals. To focus on things at 
this level is noise.

Alistair Cockburn's "Effective Use Cases" offers the theory and practice 
of this perspective in a very satisfying way. Give it a read and come 
back and we can discuss it more.


>> > He's splitting hairs over words and as much as he thinks DCI is
>> > so cool, I'm not sure he actually "gets it" himself.
>>
>> Can you translate that into some delineated professional feedback?
> 
> Ok. This is my take. DCI seems to me like an idea with a lot of
> potential. But I don't think it's an all of nothing kind of thing.

No one is saying that it is! There is still a place for your 
grandfather's object-oriented programming. There are architectures we 
can call event-driven architectures, where the interesting operations 
are all atomic. A shapes editor is a good example. It in fact has no use 
cases. Most operations are atomic and trivial: "Change the color of this 
shape." "Resize this shape." "Create this shape." Once in a great while 
you might have operations involving multiple methods of multiple shapes, 
and that's where DCI comes in.

More broadly, not everything is object-oriented, whether DCI or your 
grandfather's object-oriented design. Procedural design still has a 
place. So do state machines — and that has nothing to do with objects 
(for example, in protocol design). So does rule-based computation. So 
does functional programming as in SASL or KRC. Anyone who attacks the 
world with one weapon alone will be defeated. I wrote a whole book on 
this several years ago called "Multi-paradigm design.

Why did you think I felt that DCI was the only way?


> get the feeling that you so badly want DCI to be a Major Paradigm
> Shift that you might be pushing it's concepts too far.

Given that it took me seven years to learn it, I can speak strongly for 
the fact that it is a paradigm shift. That it is a paradigm shift has 
nothing to do with its payoff — only with the mode of understanding.

You may be seeing some of my pedagogical techniques that are commonly 
used to extemporize new ideas. There are important ways of giving 
emphasis in a one-hour presentation that would not arise if we were 
pairing at a keyboard.


> For instance, to say that an account is not a not object... going all
> the way back to the bad old days of COBOL, an account has always been
> treated as as object, even if not coded in OOP form.

I don't think so. Have you ever worked in finance or banking? I think 
your statement holds true only in lectures by college professors or by 
people outside of finance. In the latter case, the object isn't the 
account, but the name of the account (sometimes called its account 
number). Can you give me a single example in the software of a real 
financial institution where the balance is actually stored as a data 
member of an object in memory?

After you answer that, we can discuss the difference between 
object-oriented programming and class-oriented programming. One of the 
major features of DCI is that it supports object-oriented programming. 
Very few languages support object-oriented programming directly: they 
support class-oriented programming instead.


> That's because
> banks treat accounts as objects --people have them, they have ID
> numbers, etc.

You are perhaps suffering from being trapped in the old paradigm, where 
everything must be an object. Stick with me here for a few paragraphs as 
I explore this. You would have been an excellent student of Kant. In 
fact, if you look at people's mental models of their worlds, they think 
of much more than objects. An ID number is not an object: it is a handle 
to an object. An account is not an object: it is a role that several 
objects together can play.

Do the following experiment. Go to someone who has recently done a money 
transfer in their bank. Ask them to give you a general user story for 
it. Inevitably, I find people saying, "I decide on an amount, and then I 
witdraw that money from one account and put it into another account." If 
they speak more precisely they will use terms like "source account" and 
"destination account." A "source account" is not an object. It is a role 
that something can play (like a savings account).

For the time being we can pretend that savings account is a class whose 
objects can play the role of "source account." That fits the simple 
Kantian model of the world, where most things must be objects. But if we 
go more deeply, to the level of that domain (in the sense of DDD) we 
find that it is not an object — certainly not in the "D" sense of "Data" 
in DCI. It is a collection of use cases, of behaviors. That makes it a 
DCI context. An account is a context (like an account number) in which 
we can carry out algorithms (like transferring money) with other 
concepts (like other accounts, or transaction logs, or audit trails).

Where I think you are confused is that you take these elements of your 
mental model and call them objects. That was also what Kant does. To do 
so is at least not useful, and probably isn't even right. Also part of 
your mental model is the mapping from the roles "source account" and 
"destination account" onto their respective accounts (my savings account 
#O991540 and my investment account #393497654). Also part of your mental 
model is those things called accounts, and you think of them as objects. 
The problem is that the people who implement those systems don't 
implement them as objects, but as something else — the objects are at a 
much lower level. That's the real world of real financial software 
today. Really. At least in my example — which I think is representative. 
If you have a different example where an account can be an object in 
memory, I find that interesting, but I don't think it's germane to this 
discussion.

One reason I can justify DCI as a paradigm shift is that it differently 
translates the mental models of end users and programmers into code. 
Something called object-oriented programming was one way of doing it in 
the 1980s. This is another way of doing it, with different elements of 
the model. And these elements don't come out of thin air. Rebecca 
Wirfs-Brock and Trygve were having a discussion on the Hurtigruten about 
ten years ago as I was listening, and they concluded that objects don't 
have responsibilities — roles do. That is the essence of CRC cards. Most 
people think that CRC stands for "Class, Responsibility, and 
Collaborator." It does not. Rebecca wanted to call them RRR cards 
(Roles, Responsibilities and Relationships) but the C really stuck. What 
it really means is "candidate object," and it's a role. (I just verified 
this with her when she and I went together to dinner with Trygve and 
Gertrud at Øredev last year.) So you have an entire industry focusing on 
classes because they misunderstood an acronym (or popularizers of the 
technique misunderstood it – I won't mention any names). Focus on roles 
— the roles that objects can play — not classes.

There are other ideas I could bring to bear from the field of user 
experience, from Brenda Laurel's writings, and from other staples of 
object-orientation that the Java-duped public doesn't read, but take my 
word for it. This is not the object-orientation you learned in college.



> Then please make it available!

It's there (somewhere) on object-composition (are you subscribed?); it 
appears in its entirety in the book I have coming out in June (there are 
several drafts scattered here and there on the web).

Part of understanding a new paradigm is going beyond a one-hour talk to 
do your homework. Read the Artima article. There are three or four 
articles you should probably read at Trygve's web site. If you're really 
interested, come to the next course I offer on it. Just for you, I'll 
give you a free seat.


> Please don't feel that I am criticizing *you* --take it for what it
> is, my personal critique of *your presentation*.

Likewise, I am not criticising your understanding, but how you channeled 
the criticism.


>> If you feel the Ruby style bears improvement I am open to suggestions.
> 
> I can can certainly offer some suggestions, but I would have to
> understand DCI better to go beyond the surface.

I suspected as much. My guess is that your sense of distaste in the code 
may also owe to being stuck in the old paradigm.


>> > (P.S. I also think this is much more like AOP then Coplien is willing
>> > to admit.)
>>
>> Second, I'd like to know why; and first, I'd like to know why it's
>> important. Again, I think you are making the mistake that another poster
>> here warns about: confusing the language mechanisms with the design
>> ideas.
> 
> The goal of AOP is to come at a problem orthogonal to the traditional
> OOP direction. In AOP you are organizing code into aspects. These
> aspects are like contexts in DCI. Aspects are composed of advice, code
> injected into classes/objects by wrapping other methods.
> There are clear similarities. DCI goes a bit further by injecting
> methods whole-clothe, and in doing so decomposes "aspects" into a
> context and set of roles. (Actually that might be useful, might DCI
> roles make use of AOP's concept of advice too?)

No, because it makes the aspectualized code unreadable. As to why DCI is 
more than AOP, read my above long segment on mental models and 
paradigms. DCI is not just a programming trick to reflect cross-cutting. 
It can represent much higher dimensions of cross-cutting than AOP can 
and, because of the Contextual mapping of roles to objects, is much more 
dynamic. They are barely in the same league. I think you are confusing 
one of the mechanisms of Aspects with one common mechanism used to 
implement DCI in some programming languages.

This, too, is the sign of a new paradigm: everyone tries to describe it 
in terms of what they know. Some people say that DCI is like mixins. 
Some say it is like multi-paradigm design. Some say it is like aspects, 
some like dependency injection, and a million other things. What gives 
me the most grief is that there is a tiny bit of truth in each of these 
claims, just enough to keep people from making the necessary mental 
leap. To do that requires digging into it and trying it. It is like 
learning a martial art: no number of PowerPoint slides will get you 
there. You have to feel it in your bones. Most people don't even "get" 
object-oriented programming in their bones. And this transition scares 
programmers because their identity is so tied up in understanding new 
technology. That leads people to do really amusing things. For example, 
someone may not yet understand DCI well enough even to give suggestions 
on how to clean up Ruby code that illustrates it, yet feels qualified to 
criticize one of its inventors as "not getting it." O, how human we can 
be...

But back to the point... The real goal of AOP (I have this from Gregor 
Kiczales personally) is to shock people into taking reflection 
seriously. It was supposed to scare people from Java back into Lisp, 
where you can express these things cleanly. Cutpoints and wrappers and 
whoppers are native to CLOS, for example. The problem is that people 
weren't shocked: they embraced the scaffolding. I view this as one of 
the best examples of the sheep-like stupidity of the industry, 
collectively.

I'm going to get back to my vacation and attacking the fjelds of Norway.

Med venlig Hilsen, Cope
-- 
Posted via http://www.ruby-forum.com/.

In This Thread