Subject: Developers of Sympa
List archive
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new()
- From: Guillaume Rousse <address@concealed>
- To: address@concealed
- Subject: Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new()
- Date: Thu, 23 May 2013 13:05:54 +0200
Le 23/05/2013 11:58, IKEDA Soji a écrit :
Guillaume,Avoid name concatenation whenever possible:
On Thu, 23 May 2013 11:01:20 +0200
Guillaume Rousse <address@concealed> wrote:
Le 21/05/2013 16:05, address@concealed a écrit :
--- branches/sympa-6.2-branch/src/lib/Messagespool.pm 2013-05-21 13:56:37The names used for those classes doesn't bring any hint about this
UTC (rev 9262)
+++ branches/sympa-6.2-branch/src/lib/Messagespool.pm 2013-05-21 14:05:40
UTC (rev 9263)
@@ -26,6 +26,14 @@
our @ISA = qw(SympaspoolClassic);
relationship, and one has to dig in the code to understand it.
I'd rather suggest:
SympaSpool for the base class
SympaSpool::Message for the child class
And if SympaspoolClassic is meant to be a file-based implementation,
this inheritance tree could be even more explicit:
SympaSpool for the base spool class
SympaSpool::File for the file-based spool class
SympaSpool::File::Message for the file-based message spool class
Of course, the 'Sympa' prefix could also be replaced by a Sympa
namespace, as done in the cleanup branch, but that's secondary.
I agree with you on naming convention. My idea is:
- SympaspoolClassic => Sympa::SpoolFile
- Sympaspool => Sympa::SpoolSDM
- Sympa::Spool::File
- Sympa::Spool::SDM
Also, 'SDM' is pure sympa slang, and susceptible to disappear. I think Sympa::Spool::SQL would be more appropriate.
- Messagespool => Sympa::Spool::MsgI prefer explicit names over abbrevation: Sympa::Spool::Message
- KeySpool => Sympa::Spool::Mod'Key' seems more explicit than 'Mod', but I'm not sure what it is supposed to be in both cases :)
- TaskSpool => Sympa::Spool::Task (?)
The first two seem to be sibling classes. Any of child classesI don't think backend implementation (file/SQL) should be hard-coded, if they are multiple one availables. I'd rather make it a configuration option, and let final user decide which one to use.
can switch their base in the future.
Basically we have to represent two distinct classifications here:
- backend type
- content type
I'd keep the first one in a specific Sympa::Spool::Backend tree, and use either multiple inheritance or composition to achieve the various combinations.
Multiple inheritance solution:
Sympa::Spool::Message::File =
Sympa::Spool::Message +
Sympa::Spool::Backend::File
Composition solution:
A single Sympa::Spool::Message class, with a Sympa::Spool::Backend attribute.
In addition, I'm considering a few more classes (in these weeks I'mI lack enough knowledge of what you are trying to achieve here. But I'm effraid than if 'Sympa::Spool::Message' means 'a spool containing messages', 'Sympa::Spool::Automatic' doesn't has an equivalent semantics. 'Sympa::Spool::Backend', as I suggested earlier, doesn't either, tough...
working offline to refactor codes on interaction between Message object
and spools):
for 'automatic' Sympa::Spool::Automatic
for 'bounce' Sympa::Spool::Bounce
for 'digest' Sympa::Spool::Digest
How is this?
AFAIK, digest and bounce are just specific kind of messages, so if specific code is really needed there, I'd rather have them implemented as Sympa::Spool::Message subclasses.
--
Guillaume Rousse
INRIA, Direction des systèmes d'information
Domaine de Voluceau
Rocquencourt - BP 105
78153 Le Chesnay
Tel: 01 39 63 58 31
Attachment:
smime.p7s
Description: Signature cryptographique S/MIME
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
Guillaume Rousse, 05/23/2013
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
IKEDA Soji, 05/23/2013
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
Guillaume Rousse, 05/23/2013
-
Message not available
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
Guillaume Rousse, 05/24/2013
- Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(), Marc Chantreux, 05/24/2013
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
Guillaume Rousse, 05/24/2013
-
Message not available
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
Guillaume Rousse, 05/23/2013
- [sympa-developpers] Refatroing spool classes was Re: [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(), IKEDA Soji, 05/28/2013
-
Re: [sympa-developpers] [sympa-commits] sympa[9263] branches/sympa-6.2-branch/src: [-dev] Messagespool has its own constructor new(),
IKEDA Soji, 05/23/2013
Archive powered by MHonArc 2.6.19+.