Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Howdy!

One way to sort methods is "hand-rolled" versus "automated". Class::Struct (IIRC) is an example of automated, but you can't subclass (or was that "use it in a subclass"?); it has restrictions on extensibility that might preclude its use. Class::MakeMethods and Class::MethodMaker each offer extensive choices in what you make and how the innards of your class work. I've used one of them (I forget right now which one it was).

I've hand-rolled hash-based classes as well as ones based on other storage methods -- sort-of inside-out. I don't think I've gone so far as to meaningfully reinvent the wheel in automated generation.

Recently, I got a week of Java training at work. I behaved myself. Java presented some interesting ideas along with the (IMO) excessive bondage and discipline. I see Java having influence on my Perl programming (in a good way). Of course, (not intending to do the language flame thing) some of the contortions one must go through in Java are related to the fact that everything is an object...well, almost...unless it is a primitive data type... On the other hand, it has broadened my horizons on setting things up, and led me to consider how to steal from Class::*mumble* to make a Class::Java::Autogenerate or something that will create class files with the scut-work done automagically to write the accessor/mutators and declare the attributes and whatever else comes to mind to autogenerate.

yours,
Michael

In reply to Re: How do you do OO in Perl? by herveus
in thread How do YOU do OO in Perl? by batkins

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 browsing the Monastery: (2)
As of 2024-04-25 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found