role pattern lib for ruby

Discussion in 'Ruby' started by shasckaw, Feb 2, 2004.

  1. shasckaw

    shasckaw Guest

    Hello there,
    Im' searching for a ruby lib that provides a role pattern framework.
    Does anyone know about such a lib?

    If there aren't any, I'll probably try to create my own, does anyone
    have any ideas on how to proceed?

    Lio
    shasckaw, Feb 2, 2004
    #1
    1. Advertising

  2. shasckaw

    shasckaw Guest

    Thansk for the link, it looks interesting but it is perhaps too complex
    for what I intend to do. But I can give it a try... well, I'd be happy
    to try it but there isn't any files in the package, and project activity
    is near to death. I'll try to get more info about it, but I haven't much
    hope.

    If anyone has another solution, please help me!

    Lio

    Its Me wrote:
    > See Ruby Object Teams http://sourceforge.net/projects/robjectteam/
    >
    > It is based on object teams, a very rich role definition and composition
    > framework (google for its web site). Very nice.
    >
    >
    > "shasckaw" <> wrote in message
    > news:401e927b$0$314$...
    >
    >>Hello there,
    >>Im' searching for a ruby lib that provides a role pattern framework.
    >>Does anyone know about such a lib?
    >>
    >>If there aren't any, I'll probably try to create my own, does anyone
    >>have any ideas on how to proceed?
    >>
    >>Lio
    >>

    >
    >
    >
    shasckaw, Feb 3, 2004
    #2
    1. Advertising

  3. "shasckaw" <> schrieb im Newsbeitrag
    news:401ee616$0$320$...
    > Thansk for the link, it looks interesting but it is perhaps too complex
    > for what I intend to do. But I can give it a try... well, I'd be happy
    > to try it but there isn't any files in the package, and project activity
    > is near to death. I'll try to get more info about it, but I haven't much
    > hope.
    >
    > If anyone has another solution, please help me!


    Depending on what you need to do it might even be built into the language
    already. If you only need to add roles over time you could define some
    modules for the roles and add them as needed:

    irb(main):001:0> class Foo;end
    => nil
    irb(main):002:0> f=Foo.new
    => #<Foo:0x1019dfe0>
    irb(main):003:0> f.respond_to? :inject
    => false
    irb(main):004:0> f.extend Enumerable
    => #<Foo:0x1019dfe0>
    irb(main):005:0> f.respond_to? :inject
    => true

    Other than that SimpleDelegator might help you as well:
    http://www.rubycentral.com/book/lib_patterns.html

    robert

    >
    > Lio
    >
    > Its Me wrote:
    > > See Ruby Object Teams http://sourceforge.net/projects/robjectteam/
    > >
    > > It is based on object teams, a very rich role definition and

    composition
    > > framework (google for its web site). Very nice.
    > >
    > >
    > > "shasckaw" <> wrote in message
    > > news:401e927b$0$314$...
    > >
    > >>Hello there,
    > >>Im' searching for a ruby lib that provides a role pattern framework.
    > >>Does anyone know about such a lib?
    > >>
    > >>If there aren't any, I'll probably try to create my own, does anyone
    > >>have any ideas on how to proceed?
    > >>
    > >>Lio
    > >>

    > >
    > >
    > >

    >
    Robert Klemme, Feb 3, 2004
    #3
  4. shasckaw

    shasckaw Guest

    Robert Klemme wrote:
    > "shasckaw" <> schrieb im Newsbeitrag
    > news:401ee616$0$320$...
    >
    >>Thansk for the link, it looks interesting but it is perhaps too complex
    >>for what I intend to do. But I can give it a try... well, I'd be happy
    >>to try it but there isn't any files in the package, and project activity
    >>is near to death. I'll try to get more info about it, but I haven't much
    >>hope.
    >>
    >>If anyone has another solution, please help me!

    >
    >
    > Depending on what you need to do it might even be built into the language
    > already. If you only need to add roles over time you could define some
    > modules for the roles and add them as needed:
    >
    > irb(main):001:0> class Foo;end
    > => nil
    > irb(main):002:0> f=Foo.new
    > => #<Foo:0x1019dfe0>
    > irb(main):003:0> f.respond_to? :inject
    > => false
    > irb(main):004:0> f.extend Enumerable
    > => #<Foo:0x1019dfe0>
    > irb(main):005:0> f.respond_to? :inject
    > => true
    >
    > Other than that SimpleDelegator might help you as well:
    > http://www.rubycentral.com/book/lib_patterns.html
    >
    > robert
    >
    >

    I'll try that way,
    thanks for the advices,
    Lio
    shasckaw, Feb 3, 2004
    #4
  5. shasckaw

    shasckaw Guest

    shasckaw wrote:

    > Thansk for the link, it looks interesting but it is perhaps too complex
    > for what I intend to do. But I can give it a try... well, I'd be happy
    > to try it but there isn't any files in the package, and project activity
    > is near to death. I'll try to get more info about it, but I haven't much
    > hope.


    Now, I know the truth, I had a bug with my archive manager that's why I
    couldn't look into the package. I didn't think it could be my archive
    manager because I never had such problems before. I must tell the
    package is a little weird, with the extension "tgz.gz" or "tgz.tar".
    Well, no matter all this, now I can use it and that's a good new. BTW
    the develloper of robjectteams told me he doesn't use the CVS, so it's
    normal that it is empty.

    Lio

    >
    >
    > Its Me wrote:
    >
    >> See Ruby Object Teams http://sourceforge.net/projects/robjectteam/
    >>
    >> It is based on object teams, a very rich role definition and composition
    >> framework (google for its web site). Very nice.
    >>
    >>
    >> "shasckaw" <> wrote in message
    >> news:401e927b$0$314$...
    >>
    >>> Hello there,
    >>> Im' searching for a ruby lib that provides a role pattern framework.
    >>> Does anyone know about such a lib?
    >>>
    >>> If there aren't any, I'll probably try to create my own, does anyone
    >>> have any ideas on how to proceed?
    >>>
    >>> Lio
    >>>

    >>
    >>
    >>

    >
    shasckaw, Feb 4, 2004
    #5
  6. shasckaw

    Pit Capitain Guest

    Re: what is aspect-oriented s/w? (was Re: role pattern lib for ruby)

    Sam Roberts wrote about Object Teams:
    > Is there a description of it somewhere?
    > (...)
    > Can anybody help me out?


    On the Ruby Object Teams page on sourceforge there's a link called "Home Page",
    which leads you to http://objectteams.org

    My first impression is that Object Teams is a very useful paradigm. It "allows
    the programmer to encapsulate the interaction of a set of objects (roles) into a
    compound object (the team)". I've never been convinced to really start using
    AOP, but I'll definitely give the Object Teams concept a try.

    Regards,
    Pit
    Pit Capitain, Feb 4, 2004
    #6
  7. shasckaw

    Pit Capitain Guest

    Re: what is aspect-oriented s/w? (was Re: role pattern lib for ruby)

    Pit Capitain wrote:

    > Sam Roberts wrote about Object Teams:
    >
    >> Is there a description of it somewhere?
    >> (...)
    >> Can anybody help me out?

    >
    > (... Object Teams stuff ...)


    Sorry, I didn't notice you were talking about Aspect Oriented Programming in
    general. Ignore my previous post for the moment, but look at it again when you
    come to a point where you say "well, AOP is nice, but how can I use it?"

    Object Teams, which I was talking about, uses AOP under the hood to offer a very
    nice way to build components out of objects that don't have to know each other.

    Regards,
    Pit
    Pit Capitain, Feb 4, 2004
    #7
  8. shasckaw

    shasckaw Guest

    Re: what is aspect-oriented s/w? (was Re: role pattern lib for ruby)

    Hello!

    Pit Capitain wrote:
    > Pit Capitain wrote:
    >
    > Sorry, I didn't notice you were talking about Aspect Oriented
    > Programming in general. Ignore my previous post for the moment, but look
    > at it again when you come to a point where you say "well, AOP is nice,
    > but how can I use it?"

    We were talking about AOP? No, it seems you made a mistake somewhere, we
    weren't talking about that, I just wanted some lights about role
    pattern. And someone pointed out that I could use an AOP framework for
    ruby and designed with roles.
    In fact, I'm already at the point "how can I use it?". I don't even
    bother to read exhaustively the ObjectTeams site, it's too academic for
    me: most docs are in fact german academic thesis.

    > Object Teams, which I was talking about, uses AOP under the hood to
    > offer a very nice way to build components out of objects that don't have
    > to know each other.

    I will give it a try. I don't want to do something complex, I'll
    probably use only few features of robjetcteams. If robjectteams is too
    complex for me to understand, I'll seek another way (perhaps delegation
    will be enough?). Nevertheless I think robjectteams is worth the
    experience (and a shorter name ;) ).

    Lio
    shasckaw, Feb 4, 2004
    #8
  9. shasckaw

    T. Onoma Guest

    Re: what is aspect-oriented s/w? (was Re: role pattern lib for ru by)

    I think I can give a reasonable overall picture of AOP.

    Think about it from a top-down view-point, as a form of weaving code together,
    as opposed to the traditional manner of building one block on top of another.
    So lets say you want to monitor employees. So you create a model of an
    employee, then you create a logging mechinism, and say a visualizer. AOP
    allows you to weave these components together describing how they interact,
    without requiring you to specifically modify any of the code within them.
    Traditionally you would have built the logging mechinism on top of, or
    integrated into, the employee model, and likewise with the visualizer. AOP
    allows you to have much cleaner Seperations Of Concerns --and that's the real
    point of AOP.

    So an *aspect* then, is one of these concerns, and is said to be orthogonal to
    the other concerns. The weaving is accompished by describing where code is to
    be "interwoven" into other code. The code that gets "inserted" is called
    *advice* (in practice it is defined much like one does a method). This is
    accomplished by selecting join-points. *Join-points* are specific places in
    code that can have other advice code inserted into it, and are selectable by
    some descriptive syntax. This syntax will select a set of joint-points; a set
    of join-points so selected is reffered to as a *point-cut*.

    HTH,
    T.
    T. Onoma, Feb 5, 2004
    #9
  10. shasckaw

    Ara.T.Howard Guest

    Re: what is aspect-oriented s/w? (was Re: role pattern lib for ruby)

    On Thu, 5 Feb 2004, T. Onoma wrote:

    > Date: Thu, 5 Feb 2004 11:16:42 +0900
    > From: T. Onoma <>
    > Newsgroups: comp.lang.ruby
    > Subject: Re: what is aspect-oriented s/w? (was Re: role pattern lib for
    > ru by)
    >
    > I think I can give a reasonable overall picture of AOP.
    >
    > Think about it from a top-down view-point, as a form of weaving code
    > together, as opposed to the traditional manner of building one block on top
    > of another. So lets say you want to monitor employees. So you create a
    > model of an employee, then you create a logging mechinism, and say a
    > visualizer. AOP allows you to weave these components together describing how
    > they interact, without requiring you to specifically modify any of the code
    > within them. Traditionally you would have built the logging mechinism on
    > top of, or integrated into, the employee model, and likewise with the
    > visualizer. AOP allows you to have much cleaner Seperations Of Concerns
    > --and that's the real point of AOP.
    >
    > So an *aspect* then, is one of these concerns, and is said to be orthogonal
    > to the other concerns. The weaving is accompished by describing where code
    > is to be "interwoven" into other code. The code that gets "inserted" is
    > called *advice* (in practice it is defined much like one does a method).
    > This is accomplished by selecting join-points. *Join-points* are specific
    > places in code that can have other advice code inserted into it, and are
    > selectable by some descriptive syntax. This syntax will select a set of
    > joint-points; a set of join-points so selected is reffered to as a
    > *point-cut*.
    >
    > HTH,
    > T.


    thanks for that - interesting.

    -a
    --

    ATTN: please update your address books with address below!

    ===============================================================================
    | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
    | PHONE :: 303.497.6469
    | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
    | STP :: http://www.ngdc.noaa.gov/stp/
    | NGDC :: http://www.ngdc.noaa.gov/
    | NESDIS :: http://www.nesdis.noaa.gov/
    | NOAA :: http://www.noaa.gov/
    | US DOC :: http://www.commerce.gov/
    |
    | The difference between art and science is that science is what we
    | understand well enough to explain to a computer.
    | Art is everything else.
    | -- Donald Knuth, "Discover"
    |
    | /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
    ===============================================================================
    Ara.T.Howard, Feb 5, 2004
    #10
  11. shasckaw

    shasckaw Guest

    Re: what is aspect-oriented s/w? (was Re: role pattern lib for ruby)

    T. Onoma wrote:
    > I think I can give a reasonable overall picture of AOP.
    >
    > [short AOP description]
    > HTH,
    > T.


    I have already tried to understand AOP. The stuff I've already read
    about it explained aproximatively the same things as you did. But I must
    tell it doesn't help me much to understand. Those concepts Join-Points,
    Point-Cuts, advices, aspect and concerns are too blurred for me.

    Someone has already proposed AOP for python and Guido Van Rossum himself
    said him it was not its intention to do that as it is possible to do AOP
    with the use of meta-classes.

    Then I suppose it is possible to do that in ruby either. If some fair
    people could give some simple examples of practical AOP in ruby, it
    would probably help everybody to grasp the concepts.

    Meanwhile I'll try to get something from robjectteams. :)

    Cheers,
    Lio
    shasckaw, Feb 5, 2004
    #11
  12. [OT] What is a "role pattern"? (was Re: role pattern lib for ruby)

    shasckaw <> wrote in message news:<401e927b$0$314$>...
    > Hello there,
    > Im' searching for a ruby lib that provides a role pattern framework.
    > Does anyone know about such a lib?


    Is there a "role pattern" definition somewhere? Is it a design
    pattern? Or an analysis pattern? Or ...

    Just curious.

    AA
    Alfio Astanti, Feb 12, 2004
    #12
  13. Re: [OT] What is a "role pattern"? (was Re: role pattern lib for ruby)

    "Alfio Astanti" <> schrieb im Newsbeitrag
    news:...
    > shasckaw <> wrote in message

    news:<401e927b$0$314$>...
    > > Hello there,
    > > Im' searching for a ruby lib that provides a role pattern framework.
    > > Does anyone know about such a lib?

    >
    > Is there a "role pattern" definition somewhere? Is it a design
    > pattern? Or an analysis pattern? Or ...


    See http://c2.com/cgi/wiki?RoleAndPlayer - always a good place to look for
    patterns.

    Regards

    robert
    Robert Klemme, Feb 13, 2004
    #13
  14. Re: [OT] What is a "role pattern"? (was Re: role pattern lib for ruby)

    "Robert Klemme" <> wrote in message news:<c0i3fc$16pa88$-berlin.de>...
    > > Is there a "role pattern" definition somewhere? Is it a design
    > > pattern? Or an analysis pattern? Or ...

    >
    > See http://c2.com/cgi/wiki?RoleAndPlayer - always a good place to look for
    > patterns.


    Thanks a lot!! I have searched c2 indeed, but for some obscure reasons
    I skip that specific page ... :)

    AA
    Alfio Astanti, Feb 13, 2004
    #14
  15. shasckaw

    shasckaw Guest

    Re: [OT] What is a "role pattern"? (was Re: role pattern lib forruby)

    Alfio Astanti wrote:
    > "Robert Klemme" <> wrote in message news:<c0i3fc$16pa88$-berlin.de>...
    >
    >>>Is there a "role pattern" definition somewhere? Is it a design
    >>>pattern? Or an analysis pattern? Or ...

    >>
    >>See http://c2.com/cgi/wiki?RoleAndPlayer - always a good place to look for
    >>patterns.

    >
    >
    > Thanks a lot!! I have searched c2 indeed, but for some obscure reasons
    > I skip that specific page ... :)
    >
    > AA

    What is explained on that page is rather different from the academic
    papers I've found all over the web about role pattern.
    For example, robjectteams which is in fact a kind of role designing
    framework doesn't work with the same axioms. BTW robjectteams is really
    simple to understand, I really advice anybody to read its samples. Here
    is the site if you want more info:
    http://sourceforge.net/projects/robjectteam/

    Cheers,
    Lio
    shasckaw, Feb 13, 2004
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesper Stocholm
    Replies:
    2
    Views:
    8,107
    John Saunders
    Aug 23, 2003
  2. Liet Kynes
    Replies:
    0
    Views:
    492
    Liet Kynes
    Nov 26, 2003
  3. Kursat
    Replies:
    1
    Views:
    315
    Dominick Baier
    May 7, 2007
  4. Sniper Abandon
    Replies:
    2
    Views:
    117
    Ammar Ali
    Dec 6, 2010
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    157
    Iñaki Baz Castillo
    Feb 28, 2011
Loading...

Share This Page