Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Naming of modules that are mean to be inherited only?

by dsheroh (Monsignor)
on Aug 09, 2007 at 21:11 UTC ( [id://631664]=note: print w/replies, xml ) Need Help??


in reply to Naming of modules that are mean to be inherited only?

I suppose your underscore idea would be fairly clear, given its similarity to the existing convention for indicating "private" methods/properties, but appending "::Abstract" to the class name seems to be the more common way of handling it.

As far as your side questions, yes, separating the code up is good, provided you don't have to couple the modules too tightly. I break things up based on conceptual integrity rather than line count - if the Employee class needs 10,000 lines to implement, then it gets a 10,000 line file. But that's extremely rare. Looking over my current project, all of the modules but one are under 300 lines. (The exception is about 600, mostly because it has a lot of calculations in it.)

Aside from a comment at the top of my abstract class modules, I also emit warnings if the any methods are called on it that don't make sense, which also helps in catching calls that should be overridden, but weren't.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-03-29 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found