Return-Path: Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: (qmail 59778 invoked from network); 18 Jan 2011 20:43:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jan 2011 20:43:45 -0000 Received: (qmail 35708 invoked by uid 500); 18 Jan 2011 20:43:45 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 35658 invoked by uid 500); 18 Jan 2011 20:43:45 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 35649 invoked by uid 99); 18 Jan 2011 20:43:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jan 2011 20:43:45 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jan 2011 20:43:37 +0000 Received: from [192.168.1.107] (77-57-197-206.dclient.hispeed.ch [77.57.197.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 0DFC2CEC36 for ; Tue, 18 Jan 2011 21:43:16 +0100 (CET) Subject: Re: dom / message refactoring; was Re: 0.6.2 or 0.7 any time soon? From: Oleg Kalnichevski To: mime4j-dev@james.apache.org In-Reply-To: References: <4D2C0AEE.5070700@virtualpostman.co.za> <1294749756.3394.48.camel@ubuntu> <1294753533.3394.79.camel@ubuntu> <1294759001.3394.104.camel@ubuntu> <1294776829.1849.8.camel@ubuntu> <1295282617.2126.61.camel@ubuntu> Content-Type: text/plain; charset="UTF-8" Date: Tue, 18 Jan 2011 21:43:14 +0100 Message-ID: <1295383394.1937.74.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit On Tue, 2011-01-18 at 17:46 +0100, Stefano Bagnara wrote: > Il 17 gennaio 2011 17.43.37 UTC+1, Oleg Kalnichevski > ha scritto: > > Stefano et al > > > > Please review another round of API changes on the refactoring branch. > > Here is the gist of most important changes > > > > * Most of the object model implementation logic moved from 'dom' to > > 'message'. 'dom' consists mostly of pure interfaces now that do not > > impose particular internal structures, a particular implementation or a > > particular inheritance hierarchy. > > I think we loose an opportunity to keep backward compatibility in > future when we want to add methods to the 4 classes you transformed in > interfaces and I don't see advantages in turn, but, on the other side > I think we should feel free to break backward compatibility even in > future versions so this is not a big drawback and I can live with the > change (just hoping this won't be a blocker in future). > Stefano I understand the downside of having a pure interface based API. However, you seem to be very keen to position mime4j not only as a utility for parsing and building mime messages but also as an abstract Document Object Model with different / alternative implementations. I just do not see how one can honestly call the existing code in trunk an abstract Object Model if the only aspect that is abstract is field parsing. We should either drop the pretense at having an abstract DOM in mime4j and revert to the state existed before your changes or actually make an effort to define a truly abstract model even if that means more effort. I am very fine with just reverting to the old state, by the way. So, what shall I do? > > * All dom element copy / parse logic moved from individual classes to a > > utility class currently called MimeBuilder (I would prefer this class to > > be called MessageBuilder but this name is already taken) > > Maybe we should expose some of the MimeBuilder methods via the > MessageBuilder "public" factory: the bigger limit of the current DOM > api is that it doesn't expose methods to create a structured Message > from scratch (it let you set a new Body but it doesn't give a way to > create a Body). So the MimeBuilder methods could already be moved to > MessageBuilderImpl. BTW I'm just loud thinking, just go ahead with > your plan :-) > I am going to get there shortly. I just prefer to make potentially contentious changes in small, incremental steps, so that they are easier to review and agree / disagree upon. Oleg