Wouldn't it be nice...

Is PostSharp missing a great feature? How would you like the next release to look like? Share your thoughts, and we will make them happen!

Wouldn't it be nice...

Postby mrpmorris on Sat Aug 23, 2008 9:52 am

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

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...

Postby gfraiteur on Sat Aug 23, 2008 11:52 pm

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...

Postby mrpmorris on Sun Aug 24, 2008 1:32 am

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


Return to Feature Proposal


cron