Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
  • Runtime definition of classes and methods.
  • The main ideas here are:

  • We want our installed codebase on the web servers to be as minimal as possible while still leveraging a large number of classes and methods.
  • Less code is a good thing. If we can shave off several thousand lines of code to write, document and debug, then that's great.
  • This thing has to scale out in a big way. The less we have to worry about quirky behavior of any kind, the better.
  • If we can look at 8 lines of code on a web server and see that it's looping through the items in your cart, sorting them by name, calculating the subtotal, looking for cross-selling relationships, checking for discounts and making sure we still have all you items in stock, that's a good thing.
  • Declaring everything we want to iterate through as Iteratable, as well as defining its One True Sort Method, is too much work. Let the machines get paid for that.

    Defining all these methods on the core servers, and also defining "pass-through" methods on the web servers would defeat the point of having lots of functionality, but very little code.

    If, on a web server, I say: User myUser = User.retrieve(12); I want it to go get user #12 from the core server. I don't want to have to specify that this method is somehow special because it, like every other method for every single object, is defined within the core.

    The other part of the problem is if I want to override "User.retrieve()" locally. That local method should still be able to call it's superclass' method on the core server.

    With Perl, this is easy: Just use AUTOLOAD. With C#, it is possible, but not easy. There is currently no C# equivalent. We would have to define the same methods locally (by hand), but have them call out to the core using webservices. If we have 100 servers running as clients to the core, we would have to go update 100 servers with new methods whenever we add new functionality. If our application has 1000 methods running on 100 servers, it can become unmanagable very quickly.

    Consider this scenario. You have 30 websites running as clients on 1 server. Website#1 wants their Contacts to have unique email addresses, but Website#2 doesn't. Website#3 wants 1 Contact registration per household, Website#4 wants at least 3.
    We can simply have domain-level Class method overrides take care of the Contact.Create() method, leaving the rest of Contact alone.
    We could have implemented some front-end logic on their website's lead-capture form, but what about the administrative tool which everyone uses? We couldn't enforce the same validation/requirements on the backend this way.

    We can offer sensible default behavior out of the box, but when (not if) our customers come to us with special requirements, we can now accomidate them with a reasonable amount of effort, while leaving our other customers' data, objects and experience out of it.

    I would be very interested in finding out techniques for achieving the same kind of runtime flexibility and extensibility using other development platforms out there. In fact it could make writing the plugins for other platforms a bit easier later on.

    Thanks!

    In reply to Re^2: Choosing a Platform by drago99
    in thread Choosing a Platform by drago99

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post; it's "PerlMonks-approved HTML":



    • Are you posting in the right place? Check out Where do I post X? to know for sure.
    • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
      <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
    • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
    • Want more info? How to link or How to display code and escape characters are good places to start.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others perusing the Monastery: (4)
    As of 2024-04-19 14:40 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found