Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 916A4200AC8 for ; Sun, 8 May 2016 11:52:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8E6FD160A06; Sun, 8 May 2016 09:52:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D637A1609A8 for ; Sun, 8 May 2016 11:52:13 +0200 (CEST) Received: (qmail 90009 invoked by uid 500); 8 May 2016 09:52:13 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 89997 invoked by uid 99); 8 May 2016 09:52:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 May 2016 09:52:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E5C552C14F8 for ; Sun, 8 May 2016 09:52:12 +0000 (UTC) Date: Sun, 8 May 2016 09:52:12 +0000 (UTC) From: "Arno Noordover (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-9954) FormatFactory should be real Factory-pattern MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 08 May 2016 09:52:14 -0000 [ https://issues.apache.org/jira/browse/CAMEL-9954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arno Noordover updated CAMEL-9954: ---------------------------------- Attachment: CAMEL_9954__FormatFactory_should_be_real_Factory_pattern.patch Factory is implemented. Tried to write some javadoc. Tips on writing better documentation are welcome. I introduced a register of org.apache.camel.dataformat.bindy.format.factories.FormatFactoryInterface (org.apache.camel.dataformat.bindy.format.factories.FormatFactories). This is a singleton class that can be used to register additional factories. Users can for example register a FormatFactoryInterface for java.sql.Date or java.time.ZonedDateTime. > FormatFactory should be real Factory-pattern > -------------------------------------------- > > Key: CAMEL-9954 > URL: https://issues.apache.org/jira/browse/CAMEL-9954 > Project: Camel > Issue Type: Improvement > Components: camel-bindy > Reporter: Arno Noordover > Priority: Minor > Attachments: CAMEL_9954__FormatFactory_should_be_real_Factory_pattern.patch > > Original Estimate: 48h > Remaining Estimate: 48h > > The class org.apache.camel.dataformat.bindy.FormatFactory is a utility class which supports a factory-pattern. > According to the factory-pattern this should not be a utility-class but it should be a class that can be instantiated. > This class should implement an interface or extend an abstract class. > Maybe we should make a factory per Format and choose amongst the following solutions: > * let each formatter answer the question about being able to format for certain formating-options (based on type and optionally the pattern for all "numeric" format factories); > * put all formatters in a hashmap with the type as a key. > With this last solution all the "numeric" format factory should decide which format to return (e.g. BytePatternFormat or ByteFormat based on the pattern being empty or not) -- This message was sent by Atlassian JIRA (v6.3.4#6332)