* _brian_d_foy ([EMAIL PROTECTED]) [030123 18:24]:
> In article <[EMAIL PROTECTED]>, Johan
> Vromans <[EMAIL PROTECTED]> wrote:
> > I suggest to go ahead with User::Identity and Mail::Identity and see
> > how it works out. I'm convinced that Mark has done a lot of thinking
> > about it, and I don't see any better names coming up anyway.
>
> i disgree---it sounds like two similar modules are getting different
> top-level namespaces here. if the common thing is Identity, that
> concept should get pride of place in the name. I suspect the
> actual data used to make the identity do not matter that much.
>
> perhaps Mark should post some example code to show us what the
> modules do.
I agrree that there is some communility. In the original name space
request I gave a small example what my plans are.
On this moment, I try to get unicode working on e-mail headers in Mail::Box.
Till now, Mail::Box uses the infamous Mail::Address object to pass addresses.
However, that object is not unicode capabable, and will never be: it is
used in many ancient applications, published in many books, and so on.
So I am planning a new object which supports:
- username (unicode)
- e-mail address
- character set (to encode username correctly)
- pgp-key (and friends)
- signature
- address groups
- use application dependent settings
The User::Identity (representing one physical person) can have more than
one e-mail address where each of these components may differ. In my
personal situation, I will have about 10 different settings.
Now about the suggested name. My first idea was to call it
User::Idenity::Email, however:
- this is very long: people have to type it often
- a group would become User::Identity::Email::Group
- in some situations, you do not have a user related to an e-mail address
(yet: some data can be derived)
Much cleaner is Mail::Identity, mand Mail::Identity::Group
# straight forward creation
my $you = Mail::Identity->new('Hi you!', '[EMAIL PROTECTED]');
print $you; # no defaults for use object, but still usable
# "Hi you!" <[EMAIL PROTECTED]>
$msg->send(to => $you);
# based on an existing user
my $mark = User::Identity->new(fullname => 'Mark Overmeer',
charset => 'iso-8859-15', language => 'nl');
my $my_role = $mark->createEmail(adress => '[EMAIL PROTECTED]');
print $my_role; # defaults from the user object, so
# Mark Overmeer <[EMAIL PROTECTED]>
# create a group
my $us = Mail::Identity::Group->new('us', $you, $my_role);
$us->add(him => '[EMAIL PROTECTED]');
$msg->reply(From => $us, Sender => $my_role)->send;
The internals of Mail::Identity only store the information and organize
the defaults. The formatting depends on the possibilities of the
agent, so the object can find wider use.
Concluding, the reasons for Mail::Identity:
- only partially related to User::Indenity
- much shorter than User::Identity::Email, and needs to be typed often
- Mail::Identity::Group reads much better than User::Identity::Email::Group
- separate versioning.
--
Thanks for listening,
MarkOv %-]
------------------------------------------------------------------------
drs Mark A.C.J. Overmeer MARKOV Solutions
[EMAIL PROTECTED] [EMAIL PROTECTED]
http://Mark.Overmeer.net http://solutions.overmeer.net