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

Re: Interfaces for the masses!

by dokkeldepper (Friar)
on Mar 23, 2006 at 17:03 UTC ( [id://538801]=note: print w/replies, xml ) Need Help??


in reply to Interfaces for the masses!

What about abstract classes? One can always prepare empty methods in a class that croak if they are not overwritten. The usage of SQL::Statement in DBI provides an example.

BTW Java Interfaces are mostly used to mimic multiple inheritance or as a marker ("this class can this or that").

Both usages are not needed in perl because it can be done directly.

Replies are listed 'Best First'.
Re^2: Interfaces for the masses!
by rvosa (Curate) on Mar 24, 2006 at 01:27 UTC
    That is how 'interfaces' are created in BioPerl. Bio::Tree::TreeI defines the methods any if its implementors must provide. It croaks if the methods are called directly on the interface.

Log In?
Username:
Password:

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

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

    No recent polls found