SharpCrafters Forum – Wouldn't it be nice...

SharpCrafters Support Forum

        


Wouldn't it be nice... Expand / Collapse
Author
Message
Posted 8/23/2008 7:52:39 AM


Community Member
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

[RoleHolder]
public class Person
{
}


and now using that class....

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? <!-- s:-) --> <!-- s:-) -->
Post #3420
Posted 8/23/2008 9:52:22 PM


Gael Fraiteur

SharpCrafters
Yes, it would be great, and I am actually designing a next-generation solution that would support it!
Post #3421
Posted 8/23/2008 11:32:18 PM


Community Member
Wow!  That is going to be excellent!  I really think it's the way forward, patterns implemented using AOP.  I can't wait! <!-- s:-) --> <!-- s:-) -->
Post #3422
Posted 9/24/2009 7:06:51 PM


Community Member
Yeah, a [Singleton] attribute...  <!-- s:) --> <!-- s:) -->
Post #3423
« Prev Topic | Next Topic »


All times are GMT +1:00, Time now is 11:42am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.614. 8 queries. Compression Disabled.