Wouldn't it be nice...
3 posts • Page 1 of 1
Wouldn't it be nice...
This isnt a request because I suspect it is probably currently impossible (requiring compiler changes), but I thought I'd post it anyway.
What I would love to see is support for AOP during compilation and within the IDE editor itself.
Imagine the following class
and now using that class....
Not only does the fictitious example add interface support + a method to Person but it is also recognised by the compiler allowing me to cast in my code and would also show RoleHolder as a property on person when using code-insight.
Wouldn't that be great?
What I would love to see is support for AOP during compilation and within the IDE editor itself.
Imagine the following class
- Code: Select all
[RoleHolder]
public class Person
{
}
and now using that class....
- Code: Select all
public class SomeClass
{
public void DoSomething(Person person)
{
if (!person.RoleHolder.HasRole<EmployeeRole>())
throw new ArgumentException(.....);
SomeOtherClass.DoSomethingElse( (IRoleHolder) person );
}
}
Not only does the fictitious example add interface support + a method to Person but it is also recognised by the compiler allowing me to cast in my code and would also show RoleHolder as a property on person when using code-insight.
Wouldn't that be great?
- mrpmorris
- Posts: 8
- Joined: Sun Jun 08, 2008 7:27 pm
- First Name: Peter
- Last Name: Morris
Re: Wouldn't it be nice...
Yes, it would be great, and I am actually designing a next-generation solution that would support it!
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Wouldn't it be nice...
Wow! That is going to be excellent! I really think it's the way forward, patterns implemented using AOP. I can't wait! 
- mrpmorris
- Posts: 8
- Joined: Sun Jun 08, 2008 7:27 pm
- First Name: Peter
- Last Name: Morris
3 posts • Page 1 of 1
