Simon Wistow (deflatermouse) wrote,
Simon Wistow

Urge. To. Rewrite. Email::Store. Rising.

I really hate the Class method design of Email::Store - something that just doesn't make sense to me but which I inherited nonetheless.

If I ever get the time I'm pondering rewriting it as object method because, it sort of makes sense to me - a store is an object and messages and threads etc etc are objects that can be retrieved from the store.

    my $store = Email::Store->new(%config);
    foreach my $list ($store->lists()) {
        print "List: $list->name has ".scalar($list->messages)." messages\n";        
    my $message = $store->message($message_id);
    print "Subject: $message->subject\n";
    print "From: $message->from\n";
    foreach my $attachment ($message->attachments) {
        print "\t$attachement->filename\n";

So now I need to

1) Find out why the original author did it like he did

2) Work out how to deal sensibly with a complete and utter API breakage and any existing users (call it Email::Store2 maybe ?)

3) Find time. Always with the time finding.

Tags: api, email, existing users, messages, nonetheless, original author, threads, utter

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.