Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Reflections on the design of a pure-Moose web app...

by ELISHEVA (Prior)
on Mar 23, 2009 at 19:20 UTC ( [id://752688]=note: print w/replies, xml ) Need Help??


in reply to Reflections on the design of a pure-Moose web app...

I also was having a bit of trouble following your post, but it sounds to me like the "ah-ha" for you is the idea that an object is something separate from its representation - whether that representation be JSON, relational database tables, a Moose object, or a standard Perl object. By turning storage into yet another role, Moose has given you the ability to mentally decouple your notion of "thingness" from its various representations.

However, as BrowserUk hints at, this is not something specific to Moose, or even this application of Moose. Once you have latched onto the idea that the representation is not the "Thing", you are set free in many ways - even from a specific OOP framework (which is itself yet another representation). One thing that has come clear to me over the years is that a very great deal of programming is about representational changes: moving round and round, back and forth from visual image on the screen or browser to representation in program memory to database records and SQL statements to IPC stream to various document formats (XML, PDF, MSWord, RSS feeds, etc, etc) and back again.

Best, beth

  • Comment on Re: Reflections on the design of a pure-Moose web app...

Replies are listed 'Best First'.
Re^2: Reflections on the design of a pure-Moose web app...
by sundialsvc4 (Abbot) on Mar 23, 2009 at 19:39 UTC

    The “ah ha” is not so much the idea, but how cleanly Moose (and Moose roles) allowed that idea to be expressed in Perl. The speed and reliability of the development was also a nice big win.

    (Knowing that Perl-6 will be plowing the same furrows, was also nice.)

    Yes, you're right:   there aren't so many great new ideas in this world; just good, serviceable implementations of them that are found to be suitable to a particular occasion.

    To say that “a very great deal of” programming is devoted to representational-changes ... that is an understatement! I've dealt with many applications that were positively tied-into-knots not only by the data representation but by its architecture. Apps (especially web apps built by amateurs in Drupal ... ;-) ) just sorta “start down the primrose path” of what is euphemistically but accurately called CRUD, evolving without a particular plan until ... wham! ... someone, for a perfectly legitimate and important reason, needs to restructure the database. You know the drill.

    We all talk about “object-oriented programming” and data representations, and of course I'm very much talking about the selfsame thing here. The implementation was fast and clean and reliable, partly because so much of it could be “out of sight out of mind,” and these design ideas, instead of making the code-modules cruftier and more complicated, actually improved< them. I could have done the thing in “traditional Perl,” but this was, in my opinion, substantially better.

      Did you find a (publically accessible) simple starting point for your architecture, or did you evolve it yourself? (If not, would you consider writing one? :)

      The whole thing sounds very interesting (despite my "non-WEB programmer" status), and I'd love to dig around in the guts of a simple but complete example of what you've described.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        I would not say that any of these ideas are in any way new, but I really was pleased with the smoothness of this particular Perl implementatation (that is to say, Moose).

        Well, I do admit that I am somewhat the “gruff old programmer” in that I hadn't really used roles and such too much before... But that's what I like about this business:   always something new.

        I'm pondering what would be the best way to “spread the love.”  ;-) ;-) A gzip?

        And, hey guys... I'm not really trying to “toot my own horn” here! When something works, I want to share. Likewise when something really screws up, you all know that I “share” that, too! Am I, like, “the first?” Aww, heck no...   :-/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://752688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-26 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found