Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I am going to let this drop now, the tone of your node seems to suggests that this is turning a little bit heated. I am not up for that kinda discussion. Suffice to come back upon a few points. I am not trying to have the last word. If you wanna come back then go for it, I will drop off now tho.

An incidental point. Your label is wrong. As I said I am not a big label person, so I don't really care. But for this to be a singleton design pattern, you need to have a class involved

I actually originally said:

This is a nice pattern to use, I am sure you realise that it is a variant of the singleton object. *REACHES for DP*

I am aware that this is not a singleton, however it exhibits enuff of the chars to allow it to be discussed as one. So that any points I made regarding singletons will also hold of for this 'thing'. Sorry for not being more explicit in my posts.

In fact with this insight, the dbi function might well take an optional argument specifying which of several databases to connect to. Conceptually this is still simple memoization

I quite agree this is in fact the jewel/facet pattern I have been talking about for the last few nodes. I assumed you were familiar with this pattern or I would have expanded (I do not intend this to be insulting, simply that noone knows every pattern and without a common frame of reference discussion is harder).

Now do you see why this is different from the Singleton design pattern? I have not imposed any structure on how the caching works, so I can move to a more complex structure without adding related structures.

I certainly do, you are no longer describing a singleton. See comments before about intent. A singleton has specific behaviour, as does a facet.

And here is why I don't much like labels. Labels blind you. Labels turn into categorizations that are applied with little thought and foresight. This reduces the myriad of ways to understand problems into memorized channels that shall never be deviated from. I try not to limit myself like that.

Here I think our viewpoints differ, I find PATTERNS very valuable. My take is that other ppl are smarter than me so I tend to copy other peoples bright ideas rather than creating my own. Most of the views I have stated in the last few nodes could be found in OO text books. I have a strong background in OO programming and do disagree with a number of the principles at hand, I do not follow like a blind little sheep, yet I tend to follow the prescribed route of pattern interaction UNLESS something tells me it is wrong to do so. Thus far I see no good reason for not using patterns.

Interestingly tho the poing you make about lables blinding you is quite true. If I had not hidden behind lables and had instead explained the facet pattern then maybe we would have agreed sooner.


In reply to Re: Re (tilly) 7: Object Oriented Pattern help by zigster
in thread Object Oriented Pattern help by thefid

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 or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-07-05 16:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found