Groups | Blog | Home
all groups > vb.net > january 2008 >

vb.net : "Extension" properties?


Arthur Dent
1/28/2008 12:48:38 PM
Hi all, ... is there any way to use the new CompilerServices Extension
attribute with class *Properties*?

Internally properties are just implemented as a pair of functions (get/set),
aren't they? So shouldn't it be possible to create Extension Properties?

Thanks in advance,
- Arthur Dent.
Jon Skeet [C# MVP]
1/28/2008 7:14:28 PM
[quoted text, click to view]

Not at the moment.

[quoted text, click to view]

Properties are more than just a pair of functions - they're metadata
associated with the property itself.

Basically extension properties aren't supported yet - at least not in
C#. That's not to say that'll be the case forever, but for the moment
we've only got extension methods.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 3:04:46 AM
[quoted text, click to view]

<snip>

[quoted text, click to view]

What gives you that impression? Consider DateTime - all the properties
there are calculations based off a single field. There are plenty of
times when several properties can be calculated from a single field -
or where a particular type will override a property to always return
the same value.

The whole point of a property (as opposed to a field) is to allow the
implementation to do more than it would with a field. It could do lazy
loading from a database, for instance. The API is specified only in
terms of what the client can expect to be returned/set, not how that
is implemented.

[quoted text, click to view]

Would you really suggest that all the DateTime properties should be
methods?

[quoted text, click to view]

Um, you don't tend to do that with fluent interfaces.

Having extension properties would mean being able to write:

var x = 2.Dollars;

instead of

var x = 2.Dollars();

for instance, or

var meetingTime = 2.Days.From.Now;
which reads somewhat better than:
var meetingTime = 2.Days().From().Now();

Jon Skeet [C# MVP]
1/29/2008 3:57:42 AM
[quoted text, click to view]

The benefit is in readability. I wouldn't expect to see many writable
extension properties, but read-only ones would be useful.

[quoted text, click to view]

Okay, "don't tend to" was a bad choice of words. Let me rephrase:
there are plenty of situations using fluent interfaces where you don't
need to pass any parameters, at which point extension properties make
life more readable.

[quoted text, click to view]

The idea is that you can build what you need to build in the most
readable form.

[quoted text, click to view]

Well, I'd argue that's a VB issue of hiding the difference between
methods and properties, but a C# issue of not supporting extension
properties.

[quoted text, click to view]

Sure. It still means that extension properties are desirable as far as
I'm concerned.

Jon Skeet [C# MVP]
1/29/2008 5:35:05 AM
[quoted text, click to view]

Sure - that doesn't stop them being useful in C# though.

[quoted text, click to view]

Well, I disagree for at least *some* fluent interfaces - because I'd
prefer to make the methods return new values based on the old rather
than changing the existing value. This is the way that LINQ works, for
example - you chain together many sequences, rather than changing the
existing one.

Other fluent interfaces such as StringBuilder return "this" at the end
of modifying methods like Append, but I certainly wouldn't use an
extension property to do that kind of thing. Ick! In general I prefer
immutable types where they're reasonable, and fluent interfaces work
very well with that pattern.

[quoted text, click to view]

I don't see what bearing NullReferenceExceptions have on the matter at
all. Where's the connection between them and brackets?

And yes, it's a case of getting rid of the extra parentheses in *some*
cases.

[quoted text, click to view]

In this particular case, yes. It's a very specific case, however, and
in general I'm in favour of C#'s strictness here.

[quoted text, click to view]

Ick - I'd very much *not* be in favour of that. Having extension
properties (and potentially even operators) is a much cleaner and more
consistent solution.

Jon Skeet [C# MVP]
1/29/2008 6:37:02 AM
[quoted text, click to view]

I believe it should be looking at a mechanism which fits in with
everything that exists today. Extension properties are a natural
extension of where we are today - making brackets optional isn't.

[quoted text, click to view]

The properties can create objects with no problems. I don't see what
your objection is here.

[quoted text, click to view]

Various options with dates and times, numbers etc.

Put it this way: I've encountered cases where I'd like to use them,
and others have too (if you search for "extension properties" you'll
find others who wish to use them for fluent interfaces).

[quoted text, click to view]

Yes, but the point is that those extension methods aren't modifier
methods - they don't change the object they appear to be called on,
they merely return a new one. This isn't the same as the
StringBuilder.Append type behaviour, which is what I believe Martin
was talking about in the quote that you mentioned.

[quoted text, click to view]

Primarily, not necessarily "only". I certainly don't imagine that I
can foresee all possible uses.

[quoted text, click to view]

Yes, I'm aware of that.

[quoted text, click to view]

I'd guess in a similar set of situations to where it makes sense to
call a method on a null object. Where do you see the difference
between methods and properties here?

[quoted text, click to view]

In the cases I've wanted to use, yes.

[quoted text, click to view]

Yes, but I believe it's good to know that that's what you're using,
rather than calling a method.

But hey, that's part of the C# philosophy.

[quoted text, click to view]

In exactly the same way as methods are added which don't exist.

[quoted text, click to view]

The extension property values wouldn't be serialized, but that should
be fine because their values should only depend on *other* state.
Consider serialization as storing state, and we can't add state with
extension methods or properties.

[quoted text, click to view]

Do you object to extension methods as well?

[quoted text, click to view]

Which issues? Where are they problematic in places that extension
methods aren't?

[quoted text, click to view]

Probably. That doesn't mean there aren't other uses - but those would
be the majority, I imagine.

[quoted text, click to view]

Why would it have *any* effect on the CLR? Extension methods don't
have any effect on the CLR, so why should extension properties? It's
all just a compile-time bit of syntactic sugar. Heck, C# could even
gain extension properties without VB understanding of being able to
generate them...

Jon Skeet [C# MVP]
1/29/2008 7:26:00 AM
[quoted text, click to view]

No, that would be a bad thing to do - but a lot of times extension
properties would be useful even if they weren't able to store extra
state. Often they could calculate the value given the existing state.

Extension properties would also be very useful for writing fluent
interfaces.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 7:42:08 AM
[quoted text, click to view]

Certainly sounds like it - different kettle of fish entirely. (And one
with significant limitations or issues, depending on what's being
proposed. I love the idea of mixins in an appropriate way, and
particularly for interfaces which just delegate to another
implementation, but I think we need to be wary of going too far.)

Jon Skeet [C# MVP]
1/29/2008 8:29:37 AM
[quoted text, click to view]

But at the point of *use* they don't take a parameter - they act on an
instance.

[quoted text, click to view]

Who said I'd be adding line items to a record? The example Martin
happens to give isn't the only use of fluent interfaces. In many cases
the publicly exposed state is more than enough to get to the next
value.

[quoted text, click to view]

Nothing *requires* properties, but that doesn't mean there isn't an
appeal to them. Extension methods aren't *required* but they make code
easier to read.

[quoted text, click to view]

As I suggested, search for them. A search for
"extension properties" "fluent interfaces"
gets interesting hits from people such as Scott Guthrie. For instance,
from:
http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx

<quote>
Right now we don't support extension properties. It is something I
know the language teams are considering for the future - but for right
now you can only add methods.
</quote>

So it sounds like it's not exactly far-fetched.

[quoted text, click to view]

They would make various situations more readable than they are now.
Martin was talking about modifier methods, which are useful in some
cases but not all. I wouldn't use a property in such cases - but that
doesn't mean there's no value in them.

[quoted text, click to view]

Not necessarily. Suppose something had a Size property, but you only
wanted to change the Width. That ends up being:

foo.Size = new Size (newWidth, foo.Size.Height);

You could easily encapsulate that in extension properties for Height
and Width. Are there potential issues with properties not being
orthogonal? Sometimes - but sometimes it makes life easier, too.

[quoted text, click to view]

If it can have methods, I don't see why it shouldn't have properties.
As you keep pointing out, properties are just wrappers for methods.
What makes it okay for extension methods but not for extension
properties?

[quoted text, click to view]

No, it's claiming to be a method acting on a non-existent object. I
don't see why that's any better or worse.

[quoted text, click to view]

I don't need to - I'm not exactly a C# newbie. But generally, C#
doesn't give you the sort of ambiguity which VB allows. For instance,
you can't do this from C#, thank goodness:

Thread t = new Thread(...);
t.Sleep(1000);

You can in VB, although I understand it was made an optional warning/
error in VB8.

[quoted text, click to view]

Jon Skeet [C# MVP]
1/29/2008 9:10:16 AM
[quoted text, click to view]

<snip>

[quoted text, click to view]

Setting the Height property would actually set the Size property with
a copy of the existing Size value, but with the new height. Setting
the Width property would actually set the Size property with a copy of
the existing Size value, but with the new width.

Calling code which previously had to be:

foo.Size = new Size(newWidth, foo.Size.Height);
would then be
foo.Width = newWidth;

I know which I prefer to read :) The same is true when I'm only
interested in reading the height:

Old: Console.WriteLine (foo.Size.Height);
New: Console.WriteLine (foo.Height);

Again, it's that little bit easier to read (IMO).

Now, the disadvantage is that if people use both Width and Height when
setting both, they get the right results but in an inefficient way.

Bill McCarthy
1/29/2008 12:33:06 PM
Hi Arthur,

The problem is more complex than it might first seem. A property represents
a "state" of an object, whereas methods typically indicate something is
fetched or calculated. So for extension properties you would need a state
store that is associated with an instance. Sure you could do this with a
static (Shared) dictionary of some sort, but you'd also need to ensure you
use weak references so as you don't inadvertently keep the objects alive.


[quoted text, click to view]
Herfried K. Wagner [MVP]
1/29/2008 3:53:24 PM
"Jon Skeet [C# MVP]" <skeet@pobox.com> schrieb:
[quoted text, click to view]

Amanda Silver of the VB team presented an 'Extends' statement in her talk
about VB's future on TechEd EMEA 2007 which served exactly this purpose:
Extension of existing types with support extra state. This concept goes far
beyond extension methods, which are only syntactic sugar.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jon Skeet [C# MVP]
1/29/2008 5:55:44 PM
[quoted text, click to view]

No, it's not - and I never claimed it to be. You wanted an example of
how a property setter would work, and I told you - having said earlier
that for fluent interfaces I'd probably only use readonly properties.

You claimed that extension properties with setters raised "a whole heap
of issues". I've given an example to the contrary. I never claimed it
had anything to do with fluent interfaces, nor did I ever claim that
fluent interfaces would be the only use for extension properties.

[quoted text, click to view]

That's not a fluent interface in the first place though. The point
wasn't to show a fluent interface - it was to show how a writable
extension property can still make sense.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 7:07:54 PM
[quoted text, click to view]

Well, I provided fluent interface examples earlier - 1.Day.From.Now
etc.

The Size example I provided was within the context of the point of the
discussion about mutation.

[quoted text, click to view]

Often, yes - but that just shows one example of how properties can
relate to each other. It's a particularly clear one, but it's far from
unheard of to use the same expression in multiple pieces of code when
one can't change the original type.

[quoted text, click to view]

It's not what I think of as fluent. It's not something that's likely to
easily be built into a sort of sentence which is easily understandable.
There's a certain amount of personal discretion on this kind of thing
though :)

[quoted text, click to view]

No, nothing about an extension property would expose or use the
underlying storage. The implementer of the original type could still
change the implementation of any methods/properties used without the
extension property breaking.

[quoted text, click to view]

What's the exposed storage with a Size property? Is it implemented as a
Size instance inside the type, or as a pair of integers which is built
into a size on demand? Who knows? It's an implementation detail which
*isn't* exposed just because there's a Size property.

[quoted text, click to view]

The fluent interface side would be most relevant with a chain of
no-parameter conversions - dates and times are the most obvious
examples here. Beyond that I'd have to see where things lead - I'm
certainly not claiming to be a DSL or fluent interface expert, but I've
seen enough to be convinced that extension properties would be a
welcome addition.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 7:11:27 PM
[quoted text, click to view]

Is it a warning by default? I can't remember now. I guess it might
depend on whether or not the project is new or converted.

[quoted text, click to view]

It certainly used to though. I'm glad it doesn't now, but it's still a
good example of a choice where the benefits of providing choice are
outweighed by the downsides.

[quoted text, click to view]

If you *really* want to do that in C#, you can use a using directive to
introduce an alias. I believe that's clearer in intent than using a
variable to make a call to a static method which looks like an instance
method.

[quoted text, click to view]

And I believe some choices are not worth the problems they introduce.
The thread example is a readability nightmare. It was a mistake to
allow it in Java, and it was a mistake to allow it in VB, IMO.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 7:59:57 PM
[quoted text, click to view]

Probably an intermediate type which is only useful in conjunction with
a following property.

[quoted text, click to view]

That would be reasonable.

[quoted text, click to view]

Well, the intermediate type could have Now, Yesterday, Tomorrow, Today
and a few other properties as perfectly normal properties. The
extension properties would be on Int32 and TimeSpan.

[quoted text, click to view]

Examples like that are reasonably common in the world of fluent
interfaces - and you can't argue that the meaning isn't clear :)

[quoted text, click to view]

I wouldn't be suggesting that, certainly.

[quoted text, click to view]

Whereas I clearly think the reverse :)

I think fluent interfaces have moved on from the original restrictive
"always return the original context" sense, to mean a style of
programming similar to a DSL, but within the syntax of an existing
language.

Mocking is a great example of fluent interfaces - many mocking APIs are
designed with fluent interfaces so you can read a constraint out loud
and get a good sense of what's being demanded.

[quoted text, click to view]

Um, not really. Nothing has to reveal whether it's storing the data in
a single field, combined fields, a database etc. That's what I consider
to be "underlying storage". Yes, the original type has to expose the
state in some form or other, but that's to be expected.

When designing a type, you don't always know how people will use it -
particularly if you're designing something like the .NET framework
itself. Even if you knew what each different use would find beneficial
you might not want to include it all - it could make the API horrific.
However, for a particular use, it may well make sense to expose some
state in a different form from the general purpose use.

[quoted text, click to view]

I think we probably differ in terms of our understanding of "underlying
storage".

[quoted text, click to view]

Why not? Do you never want to express that? Do you find it less
readable than DateTime.Now.AddDays(1)? I know I prefer the fluent form
- so what stops it from being realistic?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 8:06:52 PM
[quoted text, click to view]

Except I haven't seen any actual downsides being introduced by you.
Yes, there'd need to be some extension to C# syntax, but that's about
all I can think of. I don't see why it's conceptually such a problem.

[quoted text, click to view]

Well yes - but it can be useful when you need to make a call
repeatedly. Java has an interesting approach where you can import
static members, so after something like (my Java is rusty)

static import java.lang.Math.*;

you can write

double x = sqrt(PI*2);

It's good when used *very sparingly*.

[quoted text, click to view]

Nah, I don't buy it. When you make it clear that you're not calling it
on a particular thread, the *only* thread that it could refer to is the
current one. I wish Thread.CurrentThread were called Thread.Current
though, and Thread.CurrentCulture were called Thread.Culture. It's a
pain when you've got:

Thread.CurrentThread.CurrentCulture ...

Ick. I'd prefer:

Thread.Current.Culture

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
1/29/2008 9:18:39 PM
[quoted text, click to view]

Remembers it.

[quoted text, click to view]

Patient: Doctor, it hurts when I do this (hits head)
Doctor: Well don't do that then

Seriously, fluent interfaces sometimes involve intermediate types which
indeed don't make sense on their own, outside the fluent interface
expression.

[quoted text, click to view]

1.Day.From.Today would be the next midnight.
1.Day.From.Now would be this time tomorrow.

[quoted text, click to view]

In Groovy:
http://developers.sun.com/learning/javaoneonline/2007/pdf/TS-1589.pdf
http://groovy.codehaus.org/Google+Data+Support

C# 3 acting like Ruby:
http://blog.troyd.net/PermaLink,guid,c4d8233b-77f4-4660-91a9-
8ea71cd358c7.aspx

[quoted text, click to view]

Can't say I like those much personally, although the Sun/Thoughtworks
paper uses something similar.

[quoted text, click to view]

True. I wouldn't like to say exactly why, but it's just a gut feeling.

<snip>

[quoted text, click to view]

The added item, or the collection it's been added to? The latter
allows:

x.Add(new Foo())
.Add(new Bar())
.Add(...)

[quoted text, click to view]

I see your point there. An alternative in the world of immutable
objects would be to return a new object equal to the previous one
except with a different width.

[quoted text, click to view]

In many cases, yes - but I can imagine cases where it would be
reasonable to use properties instead.

[quoted text, click to view]

No, I'd say it has to allow the state to be mutated appropriately. It
doesn't have to expose the nature of the storage (field, database etc).

[quoted text, click to view]

I can't help it if my understanding of "underlying storage" appears to
be radically different to yours :)

[quoted text, click to view]

Again, I'm sure we'll have to agree to differ. (Is anyone else reading
at this point?)

[quoted text, click to view]

Okay, using your definition the underlying storage of the original
exposed property is the field (or whatever) then, right? I claim that
you can write an extension property without knowing or caring that the
original type happens to use a field. The original type doesn't need to
expose its underlying storage - it needs to expose a storage interface,
whether that's through properties or methods.

[quoted text, click to view]

Where you've got a particular date, certainly use that date.

<shrugs>

Jon Skeet [C# MVP]
1/29/2008 9:21:07 PM
[quoted text, click to view]

Every time you've listed them, I've indicated why I don't think they're
relevant or downsides.

<snip>

[quoted text, click to view]

Aliases should only be used when they don't obscure the meaning. Who's
going to alias Thread, after all?

Would you say that String.Join() should be called String.JoinStrings()
just in case someone creates an alias which makes it sound like it's
joining together something completely different?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Bill McCarthy
1/29/2008 9:22:41 PM
Hi Jon,

[quoted text, click to view]


Right it can cause a LOT of issues.


[quoted text, click to view]


Well then it is a method not a property really. A property should be
similar to a field.


[quoted text, click to view]

Sure, but why use a property there when they can use a method ? A method is
actually more flexible as you can set a value as well as return a value with
the one method.



[quoted text, click to view]


Really ? How so ? You can't set a value and return a value with a
property.












Herfried K. Wagner [MVP]
1/29/2008 9:23:07 PM
"Jon Skeet [C# MVP]" <skeet@pobox.com> schrieb:
[quoted text, click to view]

You can actually do that in VB too:

\\\
Imports System.Math
....
Dim x As Double = Sqrt(PI * 2)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Bill McCarthy
1/29/2008 10:41:49 PM

[quoted text, click to view]


They are all read only properties so there is no benifit compared to a
method call.


[quoted text, click to view]


Since when ? Here, read Martin Fowler on them:
http://martinfowler.com/bliki/FluentInterface.html

To claim that fluent interfaces are only read only properties is complete
nonsense. The whole idea is you can set,fecth, calculate and read in a
chained statement.




[quoted text, click to view]

So that'd be a C# language issue requiring ()'s on methods not properties.



[quoted text, click to view]

Again, an issue in C#, not VB ;)











Bill McCarthy
1/29/2008 11:44:12 PM

[quoted text, click to view]

Again, there is no readability difference for a method compared to a
ReadOnly property, at least not in VB.


[quoted text, click to view]


Let me quote to you what Martin Fowler says:
<quote>
The common convention in the curly brace world is that modifier methods are
void, which I like because it follows the principle of
CommandQuerySeparation. This convention does get in the way of a fluent
interface, so I'm inclined to suspend the convention for this case.
</quote>

So clearly, Martin is saying that "Properties" as used in C style languages
such as C#, does get in the way of a fluent interface.


[quoted text, click to view]


Again, and extension method provides the same readability. If I read you
right, the issue you have is with having to have the ()'s. Well don't you
want them there considering with extension methods, and also properties, you
can get a null reference exception for the object being extended...
something you should never be able to get with properties ;)



[quoted text, click to view]


VB gives you the choice. C# seems to be forcing you to write things you say
are less readable ;)


[quoted text, click to view]

Or make the ()'s optional when calling extension methods.









Bill McCarthy
1/30/2008 1:05:40 AM

[quoted text, click to view]

Well if this isn't an issue for Vb, yet it is an issue for C#, then perhaps
C# should be looking at what VB does already today.

[quoted text, click to view]


You are talking read only properties; Martin is talking about richer fluency
including creation.

Just how big is the need for ReadOnly extension properties on immutable
types ? I think in virtually all cases you think of, you'll find that you
actually start needing to define the types, and hence can place real
properties in them.


[quoted text, click to view]

LINQ works as extension methods, e.g Count or Sum.



[quoted text, click to view]


So you want extension properties only for immutable types and (hence) only
ReadOnly properties ? This all for the sake of ommitting the ()'s right ?



[quoted text, click to view]


An extension method or property (if they were to exist) can be passed a null
reference as the object they are extending. Since when does it make sense
that a null object has properties and that the property getter (or setter)
would get called ??



[quoted text, click to view]


Well that's the only reason so far, and so far you've also limited it to
ReadOnly and immutable types.


[quoted text, click to view]


Why ? A property is just a wrapper for a setter and getter.

[quoted text, click to view]

Cleaner ? You'd be adding properties that don't exist. If you serialize a
type then deserialize it, it doesn't have the same properties. That should
be enough to say it isn't clean, it's a poor fudge pretending a type has
properties when it does not. If you look at all the issues associated with
extension properties, it becomes clear they aren't clean. You have already
said you'd basically only use them for ReadOnly properties, and only on
immutable types. This just to avoid having ()'s seems to be polluting the
language if you ask me. And you need to consider the effect that then has
on the CLR and cross language interoperability. Take all these things and
weigh them up against having to add ()'s








Bill McCarthy
1/30/2008 2:31:59 AM

[quoted text, click to view]

Isn't that more to do with mixins ?
Bill McCarthy
1/30/2008 2:55:30 AM

[quoted text, click to view]


No extension properties are not a natural extension for C#. In fact they go
against the C# rule of not allowing parameters to property gets *except* in
the case of indexers, in which case you are required ot use [] and the
property name Item is hidden.


[quoted text, click to view]

You're kidding me right ? The ReadOnly properties can only create a very
narrow predefined set of objects based on the public exposed state of the
object being extended. You certainly could not be adding line items to a
record.



[quoted text, click to view]


None that require properties though ;)


[quoted text, click to view]

Well I haven't seen them. I thought if it was a major issue they'd be well
known and well described. If you wish to present soem examples, that'd be
good, it may even further the conversation.


[quoted text, click to view]


I was commenting about your statement in regards to LINQ not in regards to
Martin's statements, so that wasn't the point at all ;)

Martin was talking about rich fluent interfaces, something which extension
properties in C# would NOT provide.


[quoted text, click to view]


Extension properties with setters raise a whole heap of issues. It really
is important to step back and look at basic OO principles. They aren't
properties of the object and they could only manipulate existing public
properties. It's fundamentally wrong to present them as properties.



[quoted text, click to view]

So you think a null reference should have properties ?



[quoted text, click to view]


OO 101 ;) A method is not claiming to be a property of a non existant
object.




[quoted text, click to view]


ROFL, now I know you are kidding me. C# hides indexers from you guys
because they don't want you to create properties that take parameters.
Go-on, have a look at what get's compiled and call it from IL ;)



[quoted text, click to view]


They aren't claiming to be **properties**.


[quoted text, click to view]


So who defines where that state is ? And how does that state get serialized
if it isn't inside the type ? And why don't the getter and setter have the
ability to opt in/opt out of xml serialization after all they are
*properties* ??? (rhetorical ;))


[quoted text, click to view]


Bill McCarthy
1/30/2008 3:01:31 AM

[quoted text, click to view]

yeh, I think mixins will be good. Naming issues will be the biggest
problems and that's where interfaces would come in handy. They don't
necessarily need to delegate out to another implementation though; they can
be self contained just as well.
Bill McCarthy
1/30/2008 3:52:51 AM

[quoted text, click to view]

Okay so let me call you out on this example. show *exactly* how extension
properties would solve that and make it easier.
</