camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arno Noordover (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-9954) FormatFactory should be real Factory-pattern
Date Sun, 08 May 2016 09:52:12 GMT

     [ 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)

Mime
View raw message