http://www.perlmonks.org?node_id=996338


in reply to Re^3: Altering the inheritance path of an object
in thread Altering the inheritance path of an object

update: my ascii drawing corrupt with threaded view. please have a look from single article view.

Thanks for reply. This is too interesting for me.

I used extends here, not with, like you always do. Roles, mixins are new to me.
I guess this picture vaguely like this.


                 request from client
             +------------------------->            pipeline
                        +------------------------------------------------------------------+
                        |                                                                  |
                        |                                                                  |
                        |                            r                                     |
                        |                    +-------------+                               |
                        |        +-----------+-+           v            +----+             |
                        |        |  master db  |        +--+--+              |             |
                        |        +-------------++--+    | csv |+--+          v             |
                        |                     r|  r|    +-----+   |       r r  r           |
                        |        +-------------|---|---------+    |r      r r  r r         |
                        |        |  tempral db |   |         |    |          +             |
    client              |        |             v   v         <----+          v             |
                        |        |         person    company |             generic object  |
                        |        +-------------+----+--+---+-+             with            |
                        |     r  +-------------|----|--|---|--+            various         |
                        |    +-----+ csv  <----+r   |  |   |  |            combination     |
                        |    |r  |                  |r |r  |r |            of roles        |
                        |    +-----> tab delimited <+  |   |  |              +             |
                        |    |r  |                     |   |  |              |             |
                        |    +-----> html     <--------+   |  |              |             |
                        |    |r  |                         |  |              |             |
                        |    +-----> excel    <------------+  |          <---+             |
                        |        +----------------------------+                            |
              <-------+ |                                                                  |
                        |                                                                  |
So, your generic object should know the dependencies of roles to use, plugging them , create the output. Dependencies varies from case by case, you have to use roles dynamically, with apply_all_roles.

From client, it will just look like google api, tell the pipe line parameters needed with HTML header, or sending XML.