From mime4j-dev-return-832-apmail-james-mime4j-dev-archive=james.apache.org@james.apache.org Sat Jan 02 17:32:18 2010 Return-Path: Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: (qmail 78626 invoked from network); 2 Jan 2010 17:32:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jan 2010 17:32:17 -0000 Received: (qmail 78574 invoked by uid 500); 2 Jan 2010 17:32:17 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 78539 invoked by uid 500); 2 Jan 2010 17:32:17 -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 78529 invoked by uid 99); 2 Jan 2010 17:32:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jan 2010 17:32:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jan 2010 17:32:15 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A2986234C1F0 for ; Sat, 2 Jan 2010 09:31:54 -0800 (PST) Message-ID: <1767078383.5741262453514664.JavaMail.jira@brutus.apache.org> Date: Sat, 2 Jan 2010 17:31:54 +0000 (UTC) From: "Stefano Bagnara (JIRA)" To: mime4j-dev@james.apache.org Subject: [jira] Commented: (MIME4J-156) DOM (message) classes should not be implementation specific. Move implementation to a different package (message.impl) In-Reply-To: <840040606.1262271569876.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MIME4J-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795874#action_12795874 ] Stefano Bagnara commented on MIME4J-156: ---------------------------------------- Let's talk about the DOM. The current solution is the "message", "field", "field.address" and "field.datetime" are the packages part of the DOM. Most stuff in message is abstract, most class in field are interfaces, address and datetime are abstract. Problems to be fixed: 1) ParsedField interface has "isValid" and "getParseException": from the DOM perspective a field should always be valid, shouldn't it? Shouldn't we throw exception during parsing instead of building the dom node with "isValid"/"getParseException" methods? Can you provide an use case where an exception/monitor during parsing is not enough and we need to carry the "invalidity" to the DOM? 2) Dependency on "MimeException": once we fixed #1 then we shouldn't have anymore the need to depend on MimeException but maybe we'll need a new exception for DOM related operations, DOM should not have any other dependency in mime4j, so we should probably introduce a DOMException (or something similar) Improvements: - Introduce a basic interface for the "Node" and make the whole DOM a traversable tree: this will give a lot of future options, like using XPath expressions to select mime nodes (needs more thinking but could be very interesting: "//image[@type=png]" would select all parts with a content type (image/png) at any depth level... - Add manipulation methods: once we get an instance of the "root" Message we should be able to add header, content, subparts and anything else only accessing the root object and the DOM interfaces (the same as for an xml Document.. once you have it you don't need a DocumentBuilder anymore). Opinions? > DOM (message) classes should not be implementation specific. Move implementation to a different package (message.impl) > ---------------------------------------------------------------------------------------------------------------------- > > Key: MIME4J-156 > URL: https://issues.apache.org/jira/browse/MIME4J-156 > Project: JAMES Mime4j > Issue Type: Improvement > Affects Versions: 0.6 > Reporter: Stefano Bagnara > Assignee: Stefano Bagnara > Fix For: 0.8 > > Attachments: graph-mime4j-package.png > > > Let's start "splitting" message between generic interfaces/abstract classes and specific implementations based on mime4j modules (parser). > Abstract classes vs Interface is a tricky issue wrt api. I think the important thing now is to separate implementation details from design/api. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.