You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Andres Almiray <aa...@yahoo.com> on 2006/07/28 16:53:41 UTC

[convert] Project restart ?

Hi,

Is anyone interested in restarting the project ?

Following
https://issues.apache.org/jira/browse/LANG-274,
Henri Yandell expressed interest in allowing
multidimensional array conversions for ArrayUtils, we
agreed that a patch fo ArrayUtils would be too large
and that it would be best to try a restart on the
commons-convert project.

Please let me know what you think about it.



-------------------------------------------
Ing. Andres Almiray Jaramillo
http://jroller.com/page/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.


	
	
		
___________________________________________________________ 
Do You Yahoo!? 
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Andres Almiray <aa...@yahoo.com>.
 --- Henri Yandell <fl...@gmail.com> escribió:

> What are your thoughts on the current API in
> commons-convert? It's
> much simpler to start with that and start improving
> that to get a new
> codebase + software grant added in.  Is it much the
> same, or is there
> a critical design difference?
> 

Before refactoring the code I looked at the current
convert repository and used the idea of a generic
array Conversion. Now in order to assert that certain
Converter can process a Class and provide information
about which class it converts to, I added two methods
to the Convert interface.

I have the following:

public interface Convert{
   Class convertsTo();
   boolean supports( Class clazz );
}

public interface ObjectConvert extends Convert{
   Object convert( Object value );
}

Notice that Convert has no convert() method declared,
it is intended for primitive converters to define an
appropriate method like:

public clas IntConverter implements Convert{
   int convert( Object value ){
      ...
   }
}

and then invoke it with reflection or direct type
manipulation inside the API.

I molded the Converter interface following example
code from Spring instead of doing it by constructor as
in the convert repository. This allows for any
converter to process many source classes and produce
one target class (a feature also requested on
beanutils) but imposes another degree of complexity
when locating an appropriate Converter, example:

StringConverter -> from any Class to String using
String.valueOf()
TimeZonetoStringConverter -> from TimeZone to String
using getId()


-------------------------------------------
Ing. Andres Almiray Jaramillo
http://jroller.com/page/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.


	
	
		
___________________________________________________________ 
Do You Yahoo!? 
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Henri Yandell <fl...@gmail.com>.
On 7/31/06, Andres Almiray <aa...@yahoo.com> wrote:
> Ugh! I hope you feel better by now.

Not much :)

I'd like to see commons-convert get a restart though - it's
functionality I've needed many times and come up with various
intentionally non-generic solutions (having seen how bogged down the
generic solution can get).

> In the meantime I've been reshaping the original code
> from json-lib to be more friendly.

What are your thoughts on the current API in commons-convert? It's
much simpler to start with that and start improving that to get a new
codebase + software grant added in.  Is it much the same, or is there
a critical design difference?

The last one of these I knocked up was:

public interface Formatter
    Object format(Object input);
    void setPattern(String pattern);

and

public interface Parser
    Object parse(String input, Class type);
    void setPattern(String pattern);

With a user's hat on, looking at commons-convert - I'm quite confused :)

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Andres Almiray <aa...@yahoo.com>.
Ugh! I hope you feel better by now.

In the meantime I've been reshaping the original code
from json-lib to be more friendly. There were too many
array converters; now there are the 9 array converters
only: 8 primitive and 1 generic (works with any
converter). The last statement on the
ObjectArrayConverter is not exactly true, it works on
any converter that does not convert to an array class.
The other 8 are needed because int[].class !=
Integer[].class, an so on.

I've included the other Conversion/Convert components
in the dormant repository.


 --- Henri Yandell <fl...@gmail.com> escribió:

> (and then I promptly picked up a stomach bug and my
> weekend was a
> waste of time).
> 
> On 7/28/06, Henri Yandell <fl...@gmail.com>
> wrote:
> > I'll send some thoughts at the w/e - I've been afk
> for most of the
> > week at oscon.
> >
> > Hen
> >
> > On 7/28/06, Andres Almiray <aa...@yahoo.com>
> wrote:
> > > Hi,
> > >
> > > Is anyone interested in restarting the project ?
> > >
> > > Following
> > > https://issues.apache.org/jira/browse/LANG-274,
> > > Henri Yandell expressed interest in allowing
> > > multidimensional array conversions for
> ArrayUtils, we
> > > agreed that a patch fo ArrayUtils would be too
> large
> > > and that it would be best to try a restart on
> the
> > > commons-convert project.
> > >
> > > Please let me know what you think about it.
> > >
> > >
> > >
> > > -------------------------------------------
> > > Ing. Andres Almiray Jaramillo
> > > http://jroller.com/page/aalmiray
> > > --
> > > What goes up, must come down. Ask any system
> administrator.
> > > There are 10 types of people in the world: Those
> who understand binary, and those who don't.
> > > To understand recursion, we must first
> understand recursion.
> > >
> > >
> > >
> > >
> > >
> > >
>
___________________________________________________________
> > > Do You Yahoo!?
> > > La mejor conexión a Internet y <b >2GB</b> extra
> a tu correo por $100 al mes. http://net.yahoo.com.mx
> > >
> > >
> > >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> > >
> > >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> 
> 


-------------------------------------------
Ing. Andres Almiray Jaramillo
http://jroller.com/page/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.


	
	
		
___________________________________________________________ 
Do You Yahoo!? 
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Henri Yandell <fl...@gmail.com>.
(and then I promptly picked up a stomach bug and my weekend was a
waste of time).

On 7/28/06, Henri Yandell <fl...@gmail.com> wrote:
> I'll send some thoughts at the w/e - I've been afk for most of the
> week at oscon.
>
> Hen
>
> On 7/28/06, Andres Almiray <aa...@yahoo.com> wrote:
> > Hi,
> >
> > Is anyone interested in restarting the project ?
> >
> > Following
> > https://issues.apache.org/jira/browse/LANG-274,
> > Henri Yandell expressed interest in allowing
> > multidimensional array conversions for ArrayUtils, we
> > agreed that a patch fo ArrayUtils would be too large
> > and that it would be best to try a restart on the
> > commons-convert project.
> >
> > Please let me know what you think about it.
> >
> >
> >
> > -------------------------------------------
> > Ing. Andres Almiray Jaramillo
> > http://jroller.com/page/aalmiray
> > --
> > What goes up, must come down. Ask any system administrator.
> > There are 10 types of people in the world: Those who understand binary, and those who don't.
> > To understand recursion, we must first understand recursion.
> >
> >
> >
> >
> >
> > ___________________________________________________________
> > Do You Yahoo!?
> > La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Henri Yandell <fl...@gmail.com>.
I'll send some thoughts at the w/e - I've been afk for most of the
week at oscon.

Hen

On 7/28/06, Andres Almiray <aa...@yahoo.com> wrote:
> Hi,
>
> Is anyone interested in restarting the project ?
>
> Following
> https://issues.apache.org/jira/browse/LANG-274,
> Henri Yandell expressed interest in allowing
> multidimensional array conversions for ArrayUtils, we
> agreed that a patch fo ArrayUtils would be too large
> and that it would be best to try a restart on the
> commons-convert project.
>
> Please let me know what you think about it.
>
>
>
> -------------------------------------------
> Ing. Andres Almiray Jaramillo
> http://jroller.com/page/aalmiray
> --
> What goes up, must come down. Ask any system administrator.
> There are 10 types of people in the world: Those who understand binary, and those who don't.
> To understand recursion, we must first understand recursion.
>
>
>
>
>
> ___________________________________________________________
> Do You Yahoo!?
> La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Andres Almiray <aa...@yahoo.com>.
--- Henri Yandell <fl...@gmail.com> escribió:
> On 8/1/06, Stephen Colebourne
> > I think that a key issue with its failure first
> time around was scope.
> > Personally, I would be quite comfortable to see
> [convert] only support
> > conversion between Objects and Strings and vice
> versa. ie. a very simple
> > component.
> >
> > IMHO, anything else leads into much more difficult
> design choices, and
> > leads beyond the range of commons. For example, I
> know that there is at
> > least one sf project doing Object to Object
> conversions already (but I
> > can't find a reference).
> >
> > Can we KISS?
> 
> +1.
> 
> That's the one we usually need, Object->String and
> String->Object.
> Becomes a much simpler interface then.
> 
> Hen
> 

Indeed, but beanutils already has String->Object,
we're  only missing the other half. But it is also
true that the approach for conversion in beautils is
strict (meaning: "123.45" converted to int yields an
Exception, perhaps a lenient configurable version will
do ?)


-------------------------------------------
Ing. Andres Almiray Jaramillo
http://jroller.com/page/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.


	
	
		
___________________________________________________________ 
Do You Yahoo!? 
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Henri Yandell <fl...@gmail.com>.
On 8/1/06, Stephen Colebourne <sc...@btopenworld.com> wrote:
> Oliver Zeigermann wrote:
> > 2006/7/31, Kris Nuttycombe <Kr...@noaa.gov>:
> >
> >> I'd be happy to donate a little time, if someone could give a report on
> >> what the current state of the project is and what needs to be done. Data
> >> conversion is a significant issue where I work.
> >
> > I guess convert is much more about converting one Java structure to
> > another. I need data conversion tools as well, but I doubt commons is
> > the right place for that.
>
> I think that a key issue with its failure first time around was scope.
> Personally, I would be quite comfortable to see [convert] only support
> conversion between Objects and Strings and vice versa. ie. a very simple
> component.
>
> IMHO, anything else leads into much more difficult design choices, and
> leads beyond the range of commons. For example, I know that there is at
> least one sf project doing Object to Object conversions already (but I
> can't find a reference).
>
> Can we KISS?

+1.

That's the one we usually need, Object->String and String->Object.
Becomes a much simpler interface then.

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Andres Almiray <aa...@yahoo.com>.
--- Stephen Colebourne <sc...@btopenworld.com> 
> IMHO, anything else leads into much more difficult
> design choices, and 
> leads beyond the range of commons. For example, I
> know that there is at 
> least one sf project doing Object to Object
> conversions already (but I 
> can't find a reference).
> 
> Can we KISS?
> 
> Stephen

Stephen, I believe you were referring to either of
this two projects:

http://gleamynode.net/dev/lorentz/docs/index.html
http://morph.sourceforge.net/index.html

Both claim to be based on commons-beanutils and commons-convert.

-------------------------------------------
Ing. Andres Almiray Jaramillo
http://jroller.com/page/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.


	
	
		
___________________________________________________________ 
Do You Yahoo!? 
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
Oliver Zeigermann wrote:
> 2006/7/31, Kris Nuttycombe <Kr...@noaa.gov>:
> 
>> I'd be happy to donate a little time, if someone could give a report on
>> what the current state of the project is and what needs to be done. Data
>> conversion is a significant issue where I work.
> 
> I guess convert is much more about converting one Java structure to
> another. I need data conversion tools as well, but I doubt commons is
> the right place for that.

I think that a key issue with its failure first time around was scope. 
Personally, I would be quite comfortable to see [convert] only support 
conversion between Objects and Strings and vice versa. ie. a very simple 
component.

IMHO, anything else leads into much more difficult design choices, and 
leads beyond the range of commons. For example, I know that there is at 
least one sf project doing Object to Object conversions already (but I 
can't find a reference).

Can we KISS?

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Kris Nuttycombe <Kr...@noaa.gov>.
I guess when I think about data conversion, I think of it in terms of 
converting between Java object types, so I think our goals may mesh well 
and I just didnt' express myself very clearly. For example, if convert 
gets back up and running there are a number of things that I'll want to 
drop in to my projects instead of my home-grown equivalents, 
particularly for conversion to and from the various java.sql.* types.

As a start, what do people think about moving the project to Maven 2? 
I'd be happy to put together a pom.xml file.

Kris

Oliver Zeigermann wrote:

> 2006/7/31, Kris Nuttycombe <Kr...@noaa.gov>:
>
>> I'd be happy to donate a little time, if someone could give a report on
>> what the current state of the project is and what needs to be done. Data
>> conversion is a significant issue where I work.
>
>
> I guess convert is much more about converting one Java structure to
> another. I need data conversion tools as well, but I doubt commons is
> the right place for that.
>
> WDYT?
>
> Oliver
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Oliver Zeigermann <ol...@gmail.com>.
2006/7/31, Kris Nuttycombe <Kr...@noaa.gov>:
> I'd be happy to donate a little time, if someone could give a report on
> what the current state of the project is and what needs to be done. Data
> conversion is a significant issue where I work.

I guess convert is much more about converting one Java structure to
another. I need data conversion tools as well, but I doubt commons is
the right place for that.

WDYT?

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [convert] Project restart ?

Posted by Kris Nuttycombe <Kr...@noaa.gov>.
I'd be happy to donate a little time, if someone could give a report on 
what the current state of the project is and what needs to be done. Data 
conversion is a significant issue where I work.

Kris

Andres Almiray wrote:

>Hi,
>
>Is anyone interested in restarting the project ?
>
>Following
>https://issues.apache.org/jira/browse/LANG-274,
>Henri Yandell expressed interest in allowing
>multidimensional array conversions for ArrayUtils, we
>agreed that a patch fo ArrayUtils would be too large
>and that it would be best to try a restart on the
>commons-convert project.
>
>Please let me know what you think about it.
>
>
>
>-------------------------------------------
>Ing. Andres Almiray Jaramillo
>http://jroller.com/page/aalmiray
>--
>What goes up, must come down. Ask any system administrator.
>There are 10 types of people in the world: Those who understand binary, and those who don't.
>To understand recursion, we must first understand recursion.
>
>
>	
>	
>		
>___________________________________________________________ 
>Do You Yahoo!? 
>La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org