Hi all
You know what I'd like to see? I'd like to see compiler support for AOP.
Take PostSharp as an example, it hooks into the build process and modifies
your binary output
[Log]
public void DoSomething()
{
}
adds logging to the DoSomething method. It is also possible to add
interface support
[Bindable]
public class Person
{
}
adds INotifyPropertyChanged etc.
I would love to see AOP support in the compiler because when adding
interface support you cannot do something like this
someObject.Method_Expecting_IContact(person);
because IContact is added to Person after compilation, so this would fail.
With proper IDE support I'd be able to do stuff like this
[BusinessObject]
public class Person
{
public string Name { get; set; }
}
and then also be able to write code like this
Person p = new Person();
string name = (string)
p.GetPropByIndex(Person.PropertyIndices.Name);
It's not the best example in the world, but the point is that code-insight
could complete code as if I had written it, and I'd be able to write code
that assumed I had manually written it out rather than merely using an
attribute etc. I think this would be great. Not having compile time
support for AOP decorated stuff is one of the weak points of AOP in my
opinion, it's not a spoiler or anything but it certainly would be great if
it were there!
Pete