Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: Using constant to override (abstract) methods.

by klekker (Pilgrim)
on Mar 28, 2011 at 10:27 UTC ( #895878=note: print w/replies, xml ) Need Help??

in reply to Re: Using constant to override (abstract) methods.
in thread Using constant to override (abstract) methods.

So you are asking 'Why?!'? That's why I like reading PM! :)

The example lacks some documentation that is included in the 'real' code, so I'm confident that my colleagues can deal with the code.

But more important and interessting: 'why'?

First of all: I don't claim that this is the best or most clever solution.

The motivation for this was, that we have a bunch of small classes with immutable values (like for example: error-classes).
You've got FileError, DatabaseError, FooError... all these errors share an errorCode, an errorText, an errorDescription and also a static list of errorFields which the error could affect.
So I decided to create an interface Error for these errors so that every error-class (which are using constants so far) really implements all constants.

  • Comment on Re^2: Using constant to override (abstract) methods.

Replies are listed 'Best First'.
Re^3: Using constant to override (abstract) methods.
by chromatic (Archbishop) on Mar 29, 2011 at 05:10 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2021-11-30 07:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found