Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] WritableValue constructor parmeters type
[Databinding] WritableValue constructor parmeters type [message #313551] Sun, 18 March 2007 12:23 Go to next message
Eclipse UserFriend
Hello,

I'm a happy JFace Databinding user but I was wondering this week why for
WritableValue object you choose to create:

public WritableValue(Object initialValue, Object valueType) {}

instead of

public WritableValue(Object initialValue, Class valueType) {}

?


When I wrongly switched the 2 parameters, it has led me to objects not
bound and bug difficult to find.

Would it be possible to at least do the following at the beginning of the
constructor?

assert( valueType instanceof Class);

Thanks

Fred
Re: [Databinding] WritableValue constructor parmeters type [message #313555 is a reply to message #313551] Mon, 19 March 2007 06:41 Go to previous message
Eclipse UserFriend
FREDERIC CONROTTE wrote:
> Hello,
>
> I'm a happy JFace Databinding user but I was wondering this week why for
> WritableValue object you choose to create:
>
> public WritableValue(Object initialValue, Object valueType) {}
>
> instead of
>
> public WritableValue(Object initialValue, Class valueType) {}
>
> ?
>
>
> When I wrongly switched the 2 parameters, it has led me to objects not
> bound and bug difficult to find.
>
> Would it be possible to at least do the following at the beginning of
> the constructor?
>
> assert( valueType instanceof Class);

The databinding lib is able to handle extended concepts of
types, thus "valueType" is not necessarily of type Class.
You could create your own type system (e.g. with strings)
and use it here.
AFAIK this feature is already in use, e.g in GEF(?).

One could propose a feature request for factory methods
which at on Classes, because this often is the choosen
type system, e.g.

public final class Factory {

public static final WritableValue makeWritableValue(
Object initialValue, Class valueType) {
return new WritableValue(initialValue, valueType);
}

}

Greetings from Bremen

Daniel Krügler
Previous Topic:Using CTabFolder in Form help
Next Topic:[CommonNavigator]null target in validateDop?!
Goto Forum:
  


Current Time: Wed Jul 23 18:07:52 EDT 2025

Powered by FUDForum. Page generated in 0.04853 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top