<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Architectural Atrocities, part 5: Interfaces in AS3</title>
	<atom:link href="http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/</link>
	<description></description>
	<pubDate>Fri, 21 Nov 2008 13:49:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Theo</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7664</link>
		<dc:creator>Theo</dc:creator>
		<pubDate>Mon, 17 Nov 2008 07:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7664</guid>
		<description>&lt;p&gt;@ideasculptor&lt;/p&gt;

&lt;p&gt;I very much agree that the fundamental problem seems to be that those who think prefixing interfaces with "I" have probably misunderstood their use. Perhaps a related problem is that most programmers have yet to grasp dependency injection too? They live in a world where you create new instances of classes willy-nilly, and in that context it feels wrong (to them) to let interfaces be first-class participants. When you move to dependency injection you notice that most of the things you interact with are actually interface types, and the "I" sticks out like a sore thumb.&lt;/p&gt;

&lt;p&gt;Thank you for taking your time, your examples are great and show the issue from a more concrete perspective.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@ideasculptor</p>

<p>I very much agree that the fundamental problem seems to be that those who think prefixing interfaces with &#8220;I&#8221; have probably misunderstood their use. Perhaps a related problem is that most programmers have yet to grasp dependency injection too? They live in a world where you create new instances of classes willy-nilly, and in that context it feels wrong (to them) to let interfaces be first-class participants. When you move to dependency injection you notice that most of the things you interact with are actually interface types, and the &#8220;I&#8221; sticks out like a sore thumb.</p>

<p>Thank you for taking your time, your examples are great and show the issue from a more concrete perspective.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: ideasculptor</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7663</link>
		<dc:creator>ideasculptor</dc:creator>
		<pubDate>Sun, 16 Nov 2008 21:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7663</guid>
		<description>&lt;p&gt;This one is really simple to demonstrate by example.  If I am coding to interfaces (as contracts) rather than concrete implementations, the 'I' is simply nonsensical.  If I'm using dependency injection, it is even more so, since my code will have absolutely no knowledge of the specific instance type.  If I have a service class which requires access to a DAO for users and a DAO for orders, and the particular instance of each DAO will be injected into my service class, using the 'I' makes no sense.  My service depends upon a UserDao and an OrderDao.  It doesn't depend upon an IUserDao and an IOrderDao.  Meanwhile, assuming that each DAO has basic CRUD operations via some kind of ORM framework, odds are very good that I have an abstract CrudDao implementation that both dao objects inherit from in order to gain access to basic CRUD functionality via inheritance.  So I've got AbstractCrudDao in my class hierarchy.  Note, the inclusion of 'Abstract' in the class name is not an identifier - it is a description.  If you really want descriptive interface names, then call your interfaces UserDaoInterface, etc. The 'I' serves much the same purpose, but it is a very artificial construct which actually takes away from the intent of an interface - to genericize a contract.&lt;/p&gt;

&lt;p&gt;a HibernateUserDao extends AbstractHibernateCrudDao and implement UserDao and will be referred to as a UserDao absolutely everywhere in my code except for where the dependency injection is configured to instantiate a concrete instance.&lt;/p&gt;

&lt;p&gt;With IoC, the contract becomes the first class type which all of your other code interacts with, so singling it out as 'special' via the 'I' prefix is pretty much exactly the opposite of intent.  If anything, the 'Hibernate' and 'AbstractHibernate' are the equivalent of the 'I' prefix on an interface, but are much more appropriate, marking particular implementations that are mostly beneath the radar of a developer that is merely using the api, since that dev will only interact with the contract.  The dev that maintains the API must know about the concrete implementations, but the maintaining dev necessarily must know the details of the api internals, so it makes sense for that dev to utilize what are, effectively, &lt;em&gt;private&lt;/em&gt; prefixes in order to label classes.&lt;/p&gt;

&lt;p&gt;Going down one layer and looking at the domain model itself makes this even more apparent.  Let's say that for testing's sake, my domain model is implemented as a set of interfaces with a concrete implementation that is probably (in java, anyway) annotated with information about the storage mapping of the class in question.  So I can have a Car which has a Wheel and a Tire, and all of my business logic will interact with Car, Wheel, and Tire objects, or I can have an ICar, and IWheel, and an ITire and have those names scattered throughout my codebase.  Since the fact that my app uses a HibernateDao is completely irrelevant to every other layer in my app courtesy of dependency injection, the fact that I am currently passing around hibernate-specific versions of the domain objects which were acquired via that same DAO is also irrelevant.  I only care that it adheres to the Car, Wheel, or Tire contract.&lt;/p&gt;

&lt;p&gt;So far as I can tell, the only people who still argue that interfaces need prefixes because they are not first-class types are those who either do not yet understand how programming to interfaces is absolutely vital to de-coupling code, or don't yet understand just how well a framework like Spring  can truly isolate each layer of an app from every other so that absolutely no knowledge of the implementation details of one layer is ever visible to any other layer.  My application layers never know ANYTHING other than the interfaces that describe the layers they interact with. If I have a cross-cutting concern which demands knowledge of implementation details, then I'll implement it as an AOP aspect that is injected between layers by the framework without the knowledge of any other involved layer, and again, only the IoC framework will need to know the specifics of the aspect's implementation, which must necessarily match the implementation details of the layers with which it interacts.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This one is really simple to demonstrate by example.  If I am coding to interfaces (as contracts) rather than concrete implementations, the &#8216;I&#8217; is simply nonsensical.  If I&#8217;m using dependency injection, it is even more so, since my code will have absolutely no knowledge of the specific instance type.  If I have a service class which requires access to a DAO for users and a DAO for orders, and the particular instance of each DAO will be injected into my service class, using the &#8216;I&#8217; makes no sense.  My service depends upon a UserDao and an OrderDao.  It doesn&#8217;t depend upon an IUserDao and an IOrderDao.  Meanwhile, assuming that each DAO has basic CRUD operations via some kind of ORM framework, odds are very good that I have an abstract CrudDao implementation that both dao objects inherit from in order to gain access to basic CRUD functionality via inheritance.  So I&#8217;ve got AbstractCrudDao in my class hierarchy.  Note, the inclusion of &#8216;Abstract&#8217; in the class name is not an identifier - it is a description.  If you really want descriptive interface names, then call your interfaces UserDaoInterface, etc. The &#8216;I&#8217; serves much the same purpose, but it is a very artificial construct which actually takes away from the intent of an interface - to genericize a contract.</p>

<p>a HibernateUserDao extends AbstractHibernateCrudDao and implement UserDao and will be referred to as a UserDao absolutely everywhere in my code except for where the dependency injection is configured to instantiate a concrete instance.</p>

<p>With IoC, the contract becomes the first class type which all of your other code interacts with, so singling it out as &#8217;special&#8217; via the &#8216;I&#8217; prefix is pretty much exactly the opposite of intent.  If anything, the &#8216;Hibernate&#8217; and &#8216;AbstractHibernate&#8217; are the equivalent of the &#8216;I&#8217; prefix on an interface, but are much more appropriate, marking particular implementations that are mostly beneath the radar of a developer that is merely using the api, since that dev will only interact with the contract.  The dev that maintains the API must know about the concrete implementations, but the maintaining dev necessarily must know the details of the api internals, so it makes sense for that dev to utilize what are, effectively, <em>private</em> prefixes in order to label classes.</p>

<p>Going down one layer and looking at the domain model itself makes this even more apparent.  Let&#8217;s say that for testing&#8217;s sake, my domain model is implemented as a set of interfaces with a concrete implementation that is probably (in java, anyway) annotated with information about the storage mapping of the class in question.  So I can have a Car which has a Wheel and a Tire, and all of my business logic will interact with Car, Wheel, and Tire objects, or I can have an ICar, and IWheel, and an ITire and have those names scattered throughout my codebase.  Since the fact that my app uses a HibernateDao is completely irrelevant to every other layer in my app courtesy of dependency injection, the fact that I am currently passing around hibernate-specific versions of the domain objects which were acquired via that same DAO is also irrelevant.  I only care that it adheres to the Car, Wheel, or Tire contract.</p>

<p>So far as I can tell, the only people who still argue that interfaces need prefixes because they are not first-class types are those who either do not yet understand how programming to interfaces is absolutely vital to de-coupling code, or don&#8217;t yet understand just how well a framework like Spring  can truly isolate each layer of an app from every other so that absolutely no knowledge of the implementation details of one layer is ever visible to any other layer.  My application layers never know ANYTHING other than the interfaces that describe the layers they interact with. If I have a cross-cutting concern which demands knowledge of implementation details, then I&#8217;ll implement it as an AOP aspect that is injected between layers by the framework without the knowledge of any other involved layer, and again, only the IoC framework will need to know the specifics of the aspect&#8217;s implementation, which must necessarily match the implementation details of the layers with which it interacts.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Theo</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7635</link>
		<dc:creator>Theo</dc:creator>
		<pubDate>Wed, 05 Nov 2008 15:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7635</guid>
		<description>&lt;p&gt;@Joe&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What do you think is the purpose of abstraction, access permissions [...]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Do you prefix your public methods with "p"? If not, why not?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Joe</p>

<p><em>What do you think is the purpose of abstraction, access permissions [...]</em></p>

<p>Do you prefix your public methods with &#8220;p&#8221;? If not, why not?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joe The Plummer</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7634</link>
		<dc:creator>Joe The Plummer</dc:creator>
		<pubDate>Wed, 05 Nov 2008 15:29:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7634</guid>
		<description>&lt;p&gt;Proper IDE's and proper languages (C# forces abstract declaration, so it's easily viewable, not to mention VS debugging is easier).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Proper IDE&#8217;s and proper languages (C# forces abstract declaration, so it&#8217;s easily viewable, not to mention VS debugging is easier).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joe The Plummer</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7633</link>
		<dc:creator>Joe The Plummer</dc:creator>
		<pubDate>Wed, 05 Nov 2008 15:28:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7633</guid>
		<description>&lt;p&gt;For the record.. I only agree with what you've said (besides the abstract part, that just goes against your argument). Only because if we had proper IDE's then we wouldn't need these descriptors. I think I'll drop the I from my interfaces for my next project. It's too bad Camera and Sprite are reserved words in AS3 though &#62;.&#60; (ICamera isn't :P)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For the record.. I only agree with what you&#8217;ve said (besides the abstract part, that just goes against your argument). Only because if we had proper IDE&#8217;s then we wouldn&#8217;t need these descriptors. I think I&#8217;ll drop the I from my interfaces for my next project. It&#8217;s too bad Camera and Sprite are reserved words in AS3 though &gt;.&lt; (ICamera isn&#8217;t :P)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joe The Plummer</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7632</link>
		<dc:creator>Joe The Plummer</dc:creator>
		<pubDate>Wed, 05 Nov 2008 15:21:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7632</guid>
		<description>&lt;p&gt;I mean't "with data abstraction outside users" but whatever. I won't make a dent in how you've laid this in your mind. If you're proposing "Abstract" prefix but not interface, you're hopeless. Yes, no abstract keyword exists in C++, but neither does interface. How about..&lt;/p&gt;

&lt;p&gt;I for Interface
C for Class
S for Struct
A for Abstract&lt;/p&gt;

&lt;p&gt;There you go, lol. Joking. You know a good IDE solves all these naming convention problems. Such as Visual Studio, and yet Microsoft's XNA prefixes I for interfaces.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I mean&#8217;t &#8220;with data abstraction outside users&#8221; but whatever. I won&#8217;t make a dent in how you&#8217;ve laid this in your mind. If you&#8217;re proposing &#8220;Abstract&#8221; prefix but not interface, you&#8217;re hopeless. Yes, no abstract keyword exists in C++, but neither does interface. How about..</p>

<p>I for Interface
C for Class
S for Struct
A for Abstract</p>

<p>There you go, lol. Joking. You know a good IDE solves all these naming convention problems. Such as Visual Studio, and yet Microsoft&#8217;s XNA prefixes I for interfaces.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joe The Plummer</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7631</link>
		<dc:creator>Joe The Plummer</dc:creator>
		<pubDate>Wed, 05 Nov 2008 15:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7631</guid>
		<description>&lt;p&gt;Do you have much experience in other programming languages? Namely C/C++, C#, Java? We prefix interfaces with I not because we don't understand them, but to help along users of our code. I can understand if it a solo project, otherwise I think you're mistaken. Interfaces ARE meant to force users to implement required methods, as well as assuring they are defined for explicit conversions. Not multiply inheritance, although they do solve some cases if used cleverly. Anyway, back to this gibberish about -not helping readability/usability/bug prevention with coding conventions-. What do you think is the purpose of abstraction, access permissions (private, protected, public), properties (accessors, getters/setters), constants (const correctness)? This kind of stuff is part of the standard in many languages. Required by the most professional programmers in the world. Those are ALL designed to help prevent misuse of code, and prevent bugs. Not to mention encapsulation, and abstraction play a part in this goal. With encapsulation outside users of the class should not be aware of the internal workings of the class, take it for what it is, this way the core can change without dependencies breaking.&lt;/p&gt;

&lt;p&gt;Anyway, use I for interface if you distribute your code. You're just kidding yourself if you don't. You don't have to use C for class, because class is the default nowadays (used to be S for struct back in the day).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Do you have much experience in other programming languages? Namely C/C++, C#, Java? We prefix interfaces with I not because we don&#8217;t understand them, but to help along users of our code. I can understand if it a solo project, otherwise I think you&#8217;re mistaken. Interfaces ARE meant to force users to implement required methods, as well as assuring they are defined for explicit conversions. Not multiply inheritance, although they do solve some cases if used cleverly. Anyway, back to this gibberish about -not helping readability/usability/bug prevention with coding conventions-. What do you think is the purpose of abstraction, access permissions (private, protected, public), properties (accessors, getters/setters), constants (const correctness)? This kind of stuff is part of the standard in many languages. Required by the most professional programmers in the world. Those are ALL designed to help prevent misuse of code, and prevent bugs. Not to mention encapsulation, and abstraction play a part in this goal. With encapsulation outside users of the class should not be aware of the internal workings of the class, take it for what it is, this way the core can change without dependencies breaking.</p>

<p>Anyway, use I for interface if you distribute your code. You&#8217;re just kidding yourself if you don&#8217;t. You don&#8217;t have to use C for class, because class is the default nowadays (used to be S for struct back in the day).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Theo</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7235</link>
		<dc:creator>Theo</dc:creator>
		<pubDate>Mon, 11 Aug 2008 07:46:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7235</guid>
		<description>&lt;p&gt;Good to hear that I've managed to convert someone.&lt;/p&gt;

&lt;p&gt;I wanted to add that there is also one practical argument for not prefixing your interfaces: if you want to refactor and replace a class with a number of classes, perhaps a whole hierarchy of classes, one way is to extract an interface from the first class and let all the new classes implement that interface (another way is of course to let the new classes inherit from the original class, but mindless subclassing will come back and bite you).&lt;/p&gt;

&lt;p&gt;If the interface has the same name as the class, no code that previously used the class needs to change. If you insist on prefixing your interfaces with "I", &lt;em&gt;all the code that just use the class need to change&lt;/em&gt;. It doesn't have to change much, just an "I" needs to be added, but it has to be done.&lt;/p&gt;

&lt;p&gt;Let's illustrate this with an example: say you have a class called Service. So far your application has only needed one kind of Service, but now the requirements have changed and you need to introduce a number of new service types. From the perspective of the code that uses the service it doesn't matter what kind of service it is as long as it works the way it does now. You extract an interface from the Service class, rename the class to something else and make it implement the new Service interface. Then you create the other service classes, making them all implement the Service interface. The last thing you need to change is the code that instantiates the service, making sure that it instantiates the right kind of service in the right circumstances (this part could probably benefit from being refactored into a factory). If the new interface has the same name as the old class you're done. If not, you have a couple of fun hours wading through the rest of the code searching and replacing.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Good to hear that I&#8217;ve managed to convert someone.</p>

<p>I wanted to add that there is also one practical argument for not prefixing your interfaces: if you want to refactor and replace a class with a number of classes, perhaps a whole hierarchy of classes, one way is to extract an interface from the first class and let all the new classes implement that interface (another way is of course to let the new classes inherit from the original class, but mindless subclassing will come back and bite you).</p>

<p>If the interface has the same name as the class, no code that previously used the class needs to change. If you insist on prefixing your interfaces with &#8220;I&#8221;, <em>all the code that just use the class need to change</em>. It doesn&#8217;t have to change much, just an &#8220;I&#8221; needs to be added, but it has to be done.</p>

<p>Let&#8217;s illustrate this with an example: say you have a class called Service. So far your application has only needed one kind of Service, but now the requirements have changed and you need to introduce a number of new service types. From the perspective of the code that uses the service it doesn&#8217;t matter what kind of service it is as long as it works the way it does now. You extract an interface from the Service class, rename the class to something else and make it implement the new Service interface. Then you create the other service classes, making them all implement the Service interface. The last thing you need to change is the code that instantiates the service, making sure that it instantiates the right kind of service in the right circumstances (this part could probably benefit from being refactored into a factory). If the new interface has the same name as the old class you&#8217;re done. If not, you have a couple of fun hours wading through the rest of the code searching and replacing.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: John Nesbitt</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7229</link>
		<dc:creator>John Nesbitt</dc:creator>
		<pubDate>Sun, 10 Aug 2008 13:44:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7229</guid>
		<description>&lt;p&gt;Thanks for the thoughtful reply. I do understand your Abstract... vs. I... rationale. I hadn't ever thought about it that way. I always considered both of them special types, due to viewing them from the subclass'/implementor's perspective. Looking at them from the outside-in, from the perspective of the class that actually does the instantiation and method calls, the differences between an  Abstract class and an Interface type becomes clear. Sorry,that was all horribly articulated, but basically to say that I get your point.
Thanks, also, for the info on the implicit getters and setters; I've gone all this time without taking advantage of that functionality for my Interfaces. Very handy!
Anyway, I'll lose the I on my interfaces in my next AS3 project and see how if it changes the way I structure anything.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the thoughtful reply. I do understand your Abstract&#8230; vs. I&#8230; rationale. I hadn&#8217;t ever thought about it that way. I always considered both of them special types, due to viewing them from the subclass&#8217;/implementor&#8217;s perspective. Looking at them from the outside-in, from the perspective of the class that actually does the instantiation and method calls, the differences between an  Abstract class and an Interface type becomes clear. Sorry,that was all horribly articulated, but basically to say that I get your point.
Thanks, also, for the info on the implicit getters and setters; I&#8217;ve gone all this time without taking advantage of that functionality for my Interfaces. Very handy!
Anyway, I&#8217;ll lose the I on my interfaces in my next AS3 project and see how if it changes the way I structure anything.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Theo</title>
		<link>http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7193</link>
		<dc:creator>Theo</dc:creator>
		<pubDate>Mon, 04 Aug 2008 13:46:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.iconara.net/2006/07/29/architectural-atrocities-part-5-interfaces-in-as3/#comment-7193</guid>
		<description>&lt;p&gt;@John&lt;/p&gt;

&lt;p&gt;No, I don't dislike the convention of using "able" for types, I think it's good. My point is that the name of a type should describe it. Something serializable should be called "Serializable" if it is something serializable or "Command" if it is a command, not "ISerializable" or "ICommand", because it is not a "i-serializable" or a "i-command".&lt;/p&gt;

&lt;p&gt;When it comes to abstract classes there are two variants: those that provide a basic implementation of an interface, and those that both define the interface and provide a basic implementation of it. In ActionScript and Flex an example of the first type is UIComponent (which is an abstract implementation of IUIComponent) and an example of the second is DisplayObject. In my view something like UIComponent should be called AbstractUIComponent, but something like DisplayObject should be called exactly that (however, legitimate examples of the second variant is quite rare, the first variant is almost always the right way to solve a problem). I will not say more about the second variant, and the rest of this discussion is only about the first.&lt;/p&gt;

&lt;p&gt;Why do I think that the "Abstract" prefix is a good idea when "I" for interfaces is not? The reason is that you should always type your objects as the most abstract type possible, which means that for objects that are instances of a class descendant from an abstract class the interface type that that abstract class implements is the most abstract type, never the abstract class type. Prefixing the names of abstract classes with "Abstract" both makes it obvious that the class is abstract (which is hard in languages lacking the abstract keyword), and sets the type apart, making it obvious that it is a special type of type, one that you should think twice about when you use it. This is the same argument that most people use when arguing for prefixing interfaces with "I", but here I think it is valid. Interface types should not be set apart, because they are not special, abstract types are, because they are only convenience classes and should never be seen (except, obviously, when they are used as parent classes).&lt;/p&gt;

&lt;p&gt;I hope that the different meanings of the word "abstract" weren't too confusing in that last paragraph, it really would have benefited from a diagram. A type can be more or less abstract (meaning, more or less, that it is more or less general), but a class can also be an "abstract class" (which just means that the class provides an abstract, as in not-finished, implementation of something).&lt;/p&gt;

&lt;p&gt;You also mention that interfaces "cannot dictate which properties to make publicly accessible", this isn't strictly true, in ActionScript and C#, the two languages that I know of that have implicit getters and setters (a.k.a. properties), interfaces can define properties. However, that doesn't mean that it is necessarily a good idea. It all depends on how you use the feature. It's always a bad idea to break encapsulation, and defining interfaces that dictate how an implementing class should define its inner workings (e.g. instance variables and such) is not a desirable feature.&lt;/p&gt;

&lt;p&gt;I'm not sure if this discussion persuades you further, but I hope that it does. Thanks for your comment.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@John</p>

<p>No, I don&#8217;t dislike the convention of using &#8220;able&#8221; for types, I think it&#8217;s good. My point is that the name of a type should describe it. Something serializable should be called &#8220;Serializable&#8221; if it is something serializable or &#8220;Command&#8221; if it is a command, not &#8220;ISerializable&#8221; or &#8220;ICommand&#8221;, because it is not a &#8220;i-serializable&#8221; or a &#8220;i-command&#8221;.</p>

<p>When it comes to abstract classes there are two variants: those that provide a basic implementation of an interface, and those that both define the interface and provide a basic implementation of it. In ActionScript and Flex an example of the first type is UIComponent (which is an abstract implementation of IUIComponent) and an example of the second is DisplayObject. In my view something like UIComponent should be called AbstractUIComponent, but something like DisplayObject should be called exactly that (however, legitimate examples of the second variant is quite rare, the first variant is almost always the right way to solve a problem). I will not say more about the second variant, and the rest of this discussion is only about the first.</p>

<p>Why do I think that the &#8220;Abstract&#8221; prefix is a good idea when &#8220;I&#8221; for interfaces is not? The reason is that you should always type your objects as the most abstract type possible, which means that for objects that are instances of a class descendant from an abstract class the interface type that that abstract class implements is the most abstract type, never the abstract class type. Prefixing the names of abstract classes with &#8220;Abstract&#8221; both makes it obvious that the class is abstract (which is hard in languages lacking the abstract keyword), and sets the type apart, making it obvious that it is a special type of type, one that you should think twice about when you use it. This is the same argument that most people use when arguing for prefixing interfaces with &#8220;I&#8221;, but here I think it is valid. Interface types should not be set apart, because they are not special, abstract types are, because they are only convenience classes and should never be seen (except, obviously, when they are used as parent classes).</p>

<p>I hope that the different meanings of the word &#8220;abstract&#8221; weren&#8217;t too confusing in that last paragraph, it really would have benefited from a diagram. A type can be more or less abstract (meaning, more or less, that it is more or less general), but a class can also be an &#8220;abstract class&#8221; (which just means that the class provides an abstract, as in not-finished, implementation of something).</p>

<p>You also mention that interfaces &#8220;cannot dictate which properties to make publicly accessible&#8221;, this isn&#8217;t strictly true, in ActionScript and C#, the two languages that I know of that have implicit getters and setters (a.k.a. properties), interfaces can define properties. However, that doesn&#8217;t mean that it is necessarily a good idea. It all depends on how you use the feature. It&#8217;s always a bad idea to break encapsulation, and defining interfaces that dictate how an implementing class should define its inner workings (e.g. instance variables and such) is not a desirable feature.</p>

<p>I&#8217;m not sure if this discussion persuades you further, but I hope that it does. Thanks for your comment.</p>]]></content:encoded>
	</item>
</channel>
</rss>
