Complex policies

Discussion in 'C++' started by anderberg, Dec 16, 2005.

  1. anderberg

    anderberg Guest

    Reading about policies in Andrei Alexandrescu's Modern C++
    Design, I was wondering about the complexity of policies.

    It there a general recommendation that these policies should be
    relatively small and simple (compare Create policy in the above
    book) or can they be arbitrarily complex? For instance would it
    make sense to define a FileParser policy which states how a file
    should be parsed? Or should that be deduced further to smaller
    components/policies?

    Maybe it doesn't matter as long as the policy interface is
    followed?

    --
    anderberg: People are just mutations. Some worse than others.
    anderberg, Dec 16, 2005
    #1
    1. Advertising

  2. anderberg wrote:
    > Reading about policies in Andrei Alexandrescu's Modern C++
    > Design, I was wondering about the complexity of policies.
    >
    > It there a general recommendation that these policies should be
    > relatively small and simple (compare Create policy in the above
    > book) or can they be arbitrarily complex? For instance would it
    > make sense to define a FileParser policy which states how a file
    > should be parsed? Or should that be deduced further to smaller
    > components/policies?
    >
    > Maybe it doesn't matter as long as the policy interface is
    > followed?
    >


    I think it's the choice you need to make when designing your system.
    Nothing in the language says your template arguments need to be simple
    or cannot be as complex as you can handle. Whether it makes sense to
    subdivide your more complex parts of the system into simpler ones, is
    completely up to you (and the group you're working in).

    For language-neutral advice on OOD and OOA, try 'comp.object' newsgroup.

    V
    Victor Bazarov, Dec 16, 2005
    #2
    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. green policies

    , Apr 19, 2006, in forum: HTML
    Replies:
    4
    Views:
    402
    frederick
    Apr 20, 2006
  2. Dave
    Replies:
    1
    Views:
    2,594
    Claudio Puviani
    Apr 21, 2004
  3. Dave

    Policies Vs. concepts

    Dave, Aug 26, 2004, in forum: C++
    Replies:
    0
    Views:
    336
  4. Matthias
    Replies:
    1
    Views:
    256
    Victor Bazarov
    Apr 18, 2005
  5. Erik
    Replies:
    7
    Views:
    369
Loading...

Share This Page