Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.

  •       package My::Map;

          package My::City;
          use Moose;
          has [qw{longitude latitude}] => (
                is => 'rw',
                #could make your own type, though for consistency
                isa => 'Num',
          has name => (
                is =

  • Well, the benefit of interfaces I think it that it should save you time, collecting the list of methods you need to implement in you mock object.

    In a statically typed language, you will just read the interface. And you are sure this is only what you need to implement, else the application would not compile

    In a dynamically typed language, you will either have to filter the code that use the object you want to mock to see what is bein used, a process of trial and error. Or you will rely on documentation