<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Attributes and API usability revisited</title><link>http://blogs.msdn.com/b/stevencl/archive/2004/05/12/130826.aspx</link><description>I posted a query last week requesting feedback on the use of attributes in an API and their effect on the usability of that API (thanks for all the responses!). My query was driven by a study that I was running and that is now complete. I promised that</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Attributes and API usability revisited</title><link>http://blogs.msdn.com/b/stevencl/archive/2004/05/12/130826.aspx#131830</link><pubDate>Fri, 14 May 2004 12:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:131830</guid><dc:creator>chris hollander</dc:creator><description>a follow up study into &amp;quot;best case&amp;quot; uses of attributes would be great to read about.... in fact, i would enjoy participating in that research. :)&lt;br&gt;&lt;br&gt;There are many instances in which attribution/decoration provides, IMHO,  much cleaner, easier to understand access to otherwise complex functionality.  declarative transactions come to mind; so does declarative data mapping between biz object schema and database schema.    instrumentation is also a great candidate for declarative, attribute based APIs;  i.e., wrapping methods in [Trace],[LogEvent], [IncrementPerfCounter].&lt;br&gt;&lt;br&gt;Moving towards more declarative, aspect-ish API's is a Good Thing.  I can understand people having difficulties with complex composition, and impacts on readability and such; if we were to move foward with this, we should look into mechanisms to improve the experience from a dev/ui standpoint.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=131830" width="1" height="1"&gt;</description></item><item><title>re: Attributes and API usability revisited</title><link>http://blogs.msdn.com/b/stevencl/archive/2004/05/12/130826.aspx#131249</link><pubDate>Thu, 13 May 2004 16:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:131249</guid><dc:creator>Steven Clarke</dc:creator><description>Interesting comment. The API team had some good reasons for their use of attributes in this case. In particular, the attributes place certain constraints on the way that classes can use the API which means that the execution framework the classes plug into can treat all such classes consistently.&lt;br&gt;&lt;br&gt;However, if the design of the API does not communicate this clearly, and instead communicates that the designers were just trying to look clever, then the design has obviously failed.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=131249" width="1" height="1"&gt;</description></item><item><title>re: Attributes and API usability revisited</title><link>http://blogs.msdn.com/b/stevencl/archive/2004/05/12/130826.aspx#131235</link><pubDate>Thu, 13 May 2004 16:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:131235</guid><dc:creator>B.Y.</dc:creator><description>Let me guess the design process.&lt;br&gt;&lt;br&gt;Hmm, we don't want to design just another boring API, how would that show off our brilliance and intellect ? So what should we do ? I know, core functionality thru attributes ! &lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=131235" width="1" height="1"&gt;</description></item><item><title>re: Attributes and API usability revisited</title><link>http://blogs.msdn.com/b/stevencl/archive/2004/05/12/130826.aspx#131214</link><pubDate>Thu, 13 May 2004 16:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:131214</guid><dc:creator>Steven Clarke</dc:creator><description>I think that at least some of the feedback that was obtained from the study is in agreement with your first point. Participants in the study did not appreciate or understand why they needed to both derive from some base class and use attributes on their class to achieve some functionality.&lt;br&gt;&lt;br&gt;This was vital feedback to obtain - the team that designed the API had made certain assumptions that such a design was reasonable and would work well for their target customers. The feedback from the study suggested that this is not necessarily the case.&lt;br&gt;&lt;br&gt;Regarding the rest of the results, I think we have good data to suggest that exposing APIs purely through attributes is not always perfectly fine. We most likely need to do follow up studies to determine the scenarios in which doing so makes more sense than the scenarios we considered in this study. Your example of exploiting security functionality through attributes could well be such a scenario in which it makes sense to use attributes. Clearly though, the data from this study indicates that there are also scenarios in which exposing APIs through attributes does not make sense. We need to collect more data so that we have a better understanding of the differences between these scenarios so that API designers know when it is reasonable to make extensive use of attributes and when it is unreasonable to do so.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=131214" width="1" height="1"&gt;</description></item><item><title>re: Attributes and API usability revisited</title><link>http://blogs.msdn.com/b/stevencl/archive/2004/05/12/130826.aspx#131203</link><pubDate>Thu, 13 May 2004 15:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:131203</guid><dc:creator>chris hollander</dc:creator><description>ahem:&lt;br&gt;&lt;br&gt;I am diametrically opposed to the premise of your study. &lt;br&gt;&lt;br&gt;;) ok, maybe not quite, but actually, i do think that there is an important flaw in your method.  from my reading, it sounds like you were asking participants to both derive from a base class AND use attributes... while its true that some parts of the BCL require this, I don't think thats in line with the intent of attributes.&lt;br&gt;&lt;br&gt;Attributes are incredibly valueable when you have crosscutting concerns that cannot be implemented using common base classes.  for example, the declarative security functionality is provided purely through attributes because it would have been impossible to require every class that needed declarative security to extend a common base class.  &lt;br&gt;&lt;br&gt;exposing API's purely through attributes is perfectly fine, especially if you want to preserve the ability for developers to inherit from their own base classes.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=131203" width="1" height="1"&gt;</description></item></channel></rss>