<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: The Why, What, and Where of Custom AMF Class Adapters</title>
	<atom:link href="http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/</link>
	<description>For all your Aaron Hardy needs.</description>
	<lastBuildDate>Thu, 17 May 2012 03:52:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Flex&#8217;s Data Transfer Pattern (Class Adapters) &#124; Nate's Code Vault</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-677</link>
		<dc:creator>Flex&#8217;s Data Transfer Pattern (Class Adapters) &#124; Nate's Code Vault</dc:creator>
		<pubDate>Thu, 15 Jan 2009 21:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-677</guid>
		<description>[...] a CakePHP environment that have been carefully outlined in Aaron Hardy&#8217;s blog post entitled: The Why, What, and Where of Custom AMF Class Adapters.  I have made a few comments as well as some of the other developers at MediaRAIN.  Here are some [...]</description>
		<content:encoded><![CDATA[<p>[...] a CakePHP environment that have been carefully outlined in Aaron Hardy&#8217;s blog post entitled: The Why, What, and Where of Custom AMF Class Adapters.  I have made a few comments as well as some of the other developers at MediaRAIN.  Here are some [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flex&#8217;s Data Transfer Pattern (Class Adapters) &#171; Nate&#8217;s Code Vault</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-199</link>
		<dc:creator>Flex&#8217;s Data Transfer Pattern (Class Adapters) &#171; Nate&#8217;s Code Vault</dc:creator>
		<pubDate>Sat, 20 Sep 2008 03:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-199</guid>
		<description>[...] a CakePHP environment that have been carefully outlined in Aaron Hardy&#8217;s blog post entitled: The Why, What, and Where of Custom AMF Class Adapters.  I have made a few comments as well as some of the other developers at MediaRAIN.  Here are some [...]</description>
		<content:encoded><![CDATA[<p>[...] a CakePHP environment that have been carefully outlined in Aaron Hardy&#8217;s blog post entitled: The Why, What, and Where of Custom AMF Class Adapters.  I have made a few comments as well as some of the other developers at MediaRAIN.  Here are some [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Ross</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-187</link>
		<dc:creator>Nate Ross</dc:creator>
		<pubDate>Fri, 19 Sep 2008 05:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-187</guid>
		<description>@Aaron - The reason why it is important for the Flex front-end to remain blissfully ignorant of the back-end is because this conforms to traditional MVC architecture.  In the Flex world, Flex&#039;s role in MVC is based on the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms978717.aspx&quot; rel=&quot;nofollow&quot;&gt;Data Transfer Object (DTO) approach&lt;/a&gt;.  In the broad view of things, the Flex front-end is seen as the View.  The same thing can be said with a Java JSP front-end, AJAX, Silverlight, or whatever front-end you flavor-of-the-month you are choosing.
Most web applications are structured as three-tiered applications, which, to some extent, can be compared to the Model View Controller (MVC) architectural pattern. The MVC pattern distinguishes three parts in the application : the Model, where the data is gathered, the View, which represents the data from the Model graphically and receives user inputs, and the Controller, which processes the user inputs coming from the View to update the Model.
In the case of a Flex RIA, the Controller can take the form of a Service (or business object) on the application server that reads and updates a Database (the Model) when it receives requests from the Flex application (the View) which, itself, represents the DataBase records to the user.
But the Flex application does not have to care about the details of implementations of the controller. The way it deals with requests and responds to it is definetly in Flex&#039;s not-my-problem realm, exactly like a View does not have to care about what its controller actually does. It just has to know how to communicate with it.
The same advantages for any MVC framework can be applied to a Flex application with any type of back-end application and DB. All of the arguments that Aaron made above support these potential problems solved by a true MVC architecture.
Note that this is from a Java background.  I am not terribly familiar with CakePHP, but I know that it is similar to Java&#039;s Hibernate and there have been attempts made to make CakePHP adapt more closely to the Flex front-end.  See CakePHP&#039;s &lt;a href=&quot;http://ak33m.com/?p=43&quot; rel=&quot;nofollow&quot;&gt;AS3 Inflector&lt;/a&gt; for example.
I just wanted to further explain my previous post now that I have more time to ponder and reflect on the topic :).</description>
		<content:encoded><![CDATA[<p>@Aaron &#8211; The reason why it is important for the Flex front-end to remain blissfully ignorant of the back-end is because this conforms to traditional MVC architecture.  In the Flex world, Flex&#8217;s role in MVC is based on the <a href="http://msdn.microsoft.com/en-us/library/ms978717.aspx" rel="nofollow">Data Transfer Object (DTO) approach</a>.  In the broad view of things, the Flex front-end is seen as the View.  The same thing can be said with a Java JSP front-end, AJAX, Silverlight, or whatever front-end you flavor-of-the-month you are choosing.<br />
Most web applications are structured as three-tiered applications, which, to some extent, can be compared to the Model View Controller (MVC) architectural pattern. The MVC pattern distinguishes three parts in the application : the Model, where the data is gathered, the View, which represents the data from the Model graphically and receives user inputs, and the Controller, which processes the user inputs coming from the View to update the Model.<br />
In the case of a Flex RIA, the Controller can take the form of a Service (or business object) on the application server that reads and updates a Database (the Model) when it receives requests from the Flex application (the View) which, itself, represents the DataBase records to the user.<br />
But the Flex application does not have to care about the details of implementations of the controller. The way it deals with requests and responds to it is definetly in Flex&#8217;s not-my-problem realm, exactly like a View does not have to care about what its controller actually does. It just has to know how to communicate with it.<br />
The same advantages for any MVC framework can be applied to a Flex application with any type of back-end application and DB. All of the arguments that Aaron made above support these potential problems solved by a true MVC architecture.<br />
Note that this is from a Java background.  I am not terribly familiar with CakePHP, but I know that it is similar to Java&#8217;s Hibernate and there have been attempts made to make CakePHP adapt more closely to the Flex front-end.  See CakePHP&#8217;s <a href="http://ak33m.com/?p=43" rel="nofollow">AS3 Inflector</a> for example.<br />
I just wanted to further explain my previous post now that I have more time to ponder and reflect on the topic :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ellis Elkins</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-180</link>
		<dc:creator>Ellis Elkins</dc:creator>
		<pubDate>Thu, 18 Sep 2008 16:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-180</guid>
		<description>Just like Aaron posted about how there isn&#039;t one framework for all people and all projects, there isn&#039;t one solution here. There are benefits for each of these implementations.

For Flickr or such places like them it is a good idea to have very general services to cater to many front ends.

I think something that hasn&#039;t really been said directly is that most of the applications that we build here at mediaRAIN aren&#039;t general services. The services that we most commonly design, i.e., for AncestryPress, are not for general use at all, so optimization for specific use is the best idea.

So we need to understand the benefits of each solution and analyze our project to see if we need to go more general or more specific.</description>
		<content:encoded><![CDATA[<p>Just like Aaron posted about how there isn&#8217;t one framework for all people and all projects, there isn&#8217;t one solution here. There are benefits for each of these implementations.</p>
<p>For Flickr or such places like them it is a good idea to have very general services to cater to many front ends.</p>
<p>I think something that hasn&#8217;t really been said directly is that most of the applications that we build here at mediaRAIN aren&#8217;t general services. The services that we most commonly design, i.e., for AncestryPress, are not for general use at all, so optimization for specific use is the best idea.</p>
<p>So we need to understand the benefits of each solution and analyze our project to see if we need to go more general or more specific.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Hardy</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-169</link>
		<dc:creator>Aaron Hardy</dc:creator>
		<pubDate>Thu, 18 Sep 2008 02:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-169</guid>
		<description>Hey, thanks everyone for your comments.  Here are some of my thoughts on your thoughts:

@Nate
You&#039;re definitely right; however, backend developers can say the same thing about having the adapter on the front-end.  They can remain blissfully ignorant of what goes on on the frontend.  So there&#039;s a pro and con for each of the possible adapter locations.

@Bryce
You know it!  Seriously though, as a frontender I wouldn&#039;t be completely opposed to doing the adapter work myself as long as it meant it was in the right location.  It may just mean allocating more backend resources rather than more front-end resources.

@John
Good comments.  Some of them require more of a response....

You mentioned that having the adapter on the frontend sometimes strips off an entire layer on the backend.  The opposite is true as well.  When the adapter is on the backend, it sometimes strips off an entire layer from the frontend.

I agree that if you have thousands of users using an application it can be nice to use their resources instead of your own; however, when you&#039;re trying to cater to the user, using more of their machine might not be the best option.  If it&#039;s an internal application your employees are using and you&#039;d like to distribute the process load to their computers it&#039;s probably more reasonable as you&#039;re not necessarily trying to cater to them.  Also, keep in mind the user&#039;s CPU may be just as taxed as the server&#039;s CPU...the only difference is we might not be able to purchase more equipment to fix the problem.

You mentioned that an adapter on the client side is already sitting in context.  Actually, only half of it is in context: the frontend half.  Just as a backend developer creating the adapter has no certain understanding of frontend models, a frontend developer creating the adapter has no certain understanding of the backend models.  The same goes for language constraints.  If the backend class has a property name supported in the backend language, it may not be supported in the frontend language.

You mentioned a single API can serve multiple clients.  This is true, but it doesn&#039;t decrease the number of adapters needed.  If two flex applications want to use the same API and they need a different class structure than what they receive, they&#039;re each going to have their own adapters.  If the adapters were on the backend, there would likely still be two adapters.  You do bring up a great case though of when an adapter should not be on the backend and I should have addressed it.  In the case of Flickr, they can&#039;t provide a specific implementation for each one.  It&#039;s too expensive and time consuming.  What better way to keep costs low than to push them onto the entity building the client application.  Instead of building services specific to each need, they resort to a more generic, less optimized API interface.  I say less optimized because such APIs ship a lot of extra data back that you may not need (the Bugzilla and iTunes APIs come to mind).  They have to send it though because &lt;strong&gt;somebody&lt;/strong&gt; may need it.  Similarly, the API sends data in XML not because it&#039;s the most optimized solution but because they have to provide a format that dozens of client technologies will support.  If they had a gabajillion dollars to burn and were concerned with the performance of client applications, I&#039;d be willing to bet they would provide an optimized solution for everyone who requested it.  They don&#039;t though because development and maintenance costs money and they don&#039;t have a gabajillion dollars to burn. So, if our main goal were to provide an API that supports the widest array of frontend implementations and we couldn&#039;t build a custom service for each, it &lt;strong&gt;would&lt;/strong&gt; be a bad idea to have the adapter on the backend just as it would be a bad idea to use AMF.  Why don&#039;t we all ditch AMF and lean classes and replace them with XML that includes every data property?  Because in some (most?) cases one entity either (1) is paying for development/maintenance of both the backend and frontend(s) (therefore no costs are cut by creating the adapter on the frontend) or (2) developers won&#039;t/can&#039;t be available to develop a customized service for each frontend client that needs one (whether due to money, resources, time or otherwise).  If neither of those cases are true, optimizing the service by creating the adapter on the backend is probably worthwhile.  If this weren&#039;t the case, niche technologies like AMF wouldn&#039;t even exist.  All services would provide XML loaded with every possibly usable property.

I agree with your last point that a layer comes in handy when integrating with services from various vendors. I just want to clarify that when I said an adapter layer should generally go on the backend, I did not mean it was okay to exclude some form of a service layer from the frontend.  It&#039;s not.  I can see how that may have been interpreted though because adapter logic can be placed in the service layer rather than a layer of its own.  To explain how they relate in such a case, in most service layer implementations, there are interfaces (the object-oriented kind) that specify methods like getUser(), getOrders(), and getCustomers().  These are only the required method signatures, not the logic.  The developer then creates service-specific classes that implement those methods.  For compatibility with the AMF service, the developer would create a service class that implements the interface by providing logic for each of the required methods.  The logic in this class would be specific to AMF and &lt;strong&gt;may or may not&lt;/strong&gt; include adapter logic (mapping a backend class to a frontend class).  Then the developer would create an XML service class that likewise implements the interface by providing logic for each of the required methods.  The logic in this second service class would be specific to XML and &lt;strong&gt;may or may not&lt;/strong&gt; include adapter logic.  The existence of adapter logic in the XML service class is in no way dependent on whether the AMF service class has adapter logic within it.  With the service layer in place and the application calls a specific service (if we&#039;re talking about the client) or responds to a specific request (if we&#039;re talking about the server), the service configuration just points to the right service class and all the methods are implemented as expected.  So, when you say that any Flex framework should have some sort of service/adapter layer, they generally do have a service layer if they&#039;re in any way related to Cairngorm, PureMVC, or just have a competent developer.  The frontend service layer is slightly different than the one I laid out though because its calls are asynchronous and therefore must also deal with result and fault handlers.  Other than creating classes to support a new vendor&#039;s service (which may or may not include adapter logic), only small adjustments are needed to ensure flexibility with both.  In other words, having the adapter logic on the frontend doesn&#039;t make the application more flexible with new service types, you have to make new service classes either way.

On a related note, almost all frontend &lt;strong&gt;and&lt;/strong&gt; backend applications should have a service layer if they support service-related communication.  ASP.NET&#039;s starter kit &lt;a href=&quot;http://www.asp.net/Downloads/starter-kits/the-beer-house/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;The Beer House&lt;/a&gt; is a fantastic example of a flexible &lt;strong&gt;data access&lt;/strong&gt; layer implementation where you can swap different kinds of databases and it&#039;s seamless.  Although it&#039;s for databases, the implementation for a backend &lt;strong&gt;service&lt;/strong&gt; layer would be very similar.

Thanks for joining the conversation!  Keep it coming.</description>
		<content:encoded><![CDATA[<p>Hey, thanks everyone for your comments.  Here are some of my thoughts on your thoughts:</p>
<p>@Nate<br />
You&#8217;re definitely right; however, backend developers can say the same thing about having the adapter on the front-end.  They can remain blissfully ignorant of what goes on on the frontend.  So there&#8217;s a pro and con for each of the possible adapter locations.</p>
<p>@Bryce<br />
You know it!  Seriously though, as a frontender I wouldn&#8217;t be completely opposed to doing the adapter work myself as long as it meant it was in the right location.  It may just mean allocating more backend resources rather than more front-end resources.</p>
<p>@John<br />
Good comments.  Some of them require more of a response&#8230;.</p>
<p>You mentioned that having the adapter on the frontend sometimes strips off an entire layer on the backend.  The opposite is true as well.  When the adapter is on the backend, it sometimes strips off an entire layer from the frontend.</p>
<p>I agree that if you have thousands of users using an application it can be nice to use their resources instead of your own; however, when you&#8217;re trying to cater to the user, using more of their machine might not be the best option.  If it&#8217;s an internal application your employees are using and you&#8217;d like to distribute the process load to their computers it&#8217;s probably more reasonable as you&#8217;re not necessarily trying to cater to them.  Also, keep in mind the user&#8217;s CPU may be just as taxed as the server&#8217;s CPU&#8230;the only difference is we might not be able to purchase more equipment to fix the problem.</p>
<p>You mentioned that an adapter on the client side is already sitting in context.  Actually, only half of it is in context: the frontend half.  Just as a backend developer creating the adapter has no certain understanding of frontend models, a frontend developer creating the adapter has no certain understanding of the backend models.  The same goes for language constraints.  If the backend class has a property name supported in the backend language, it may not be supported in the frontend language.</p>
<p>You mentioned a single API can serve multiple clients.  This is true, but it doesn&#8217;t decrease the number of adapters needed.  If two flex applications want to use the same API and they need a different class structure than what they receive, they&#8217;re each going to have their own adapters.  If the adapters were on the backend, there would likely still be two adapters.  You do bring up a great case though of when an adapter should not be on the backend and I should have addressed it.  In the case of Flickr, they can&#8217;t provide a specific implementation for each one.  It&#8217;s too expensive and time consuming.  What better way to keep costs low than to push them onto the entity building the client application.  Instead of building services specific to each need, they resort to a more generic, less optimized API interface.  I say less optimized because such APIs ship a lot of extra data back that you may not need (the Bugzilla and iTunes APIs come to mind).  They have to send it though because <strong>somebody</strong> may need it.  Similarly, the API sends data in XML not because it&#8217;s the most optimized solution but because they have to provide a format that dozens of client technologies will support.  If they had a gabajillion dollars to burn and were concerned with the performance of client applications, I&#8217;d be willing to bet they would provide an optimized solution for everyone who requested it.  They don&#8217;t though because development and maintenance costs money and they don&#8217;t have a gabajillion dollars to burn. So, if our main goal were to provide an API that supports the widest array of frontend implementations and we couldn&#8217;t build a custom service for each, it <strong>would</strong> be a bad idea to have the adapter on the backend just as it would be a bad idea to use AMF.  Why don&#8217;t we all ditch AMF and lean classes and replace them with XML that includes every data property?  Because in some (most?) cases one entity either (1) is paying for development/maintenance of both the backend and frontend(s) (therefore no costs are cut by creating the adapter on the frontend) or (2) developers won&#8217;t/can&#8217;t be available to develop a customized service for each frontend client that needs one (whether due to money, resources, time or otherwise).  If neither of those cases are true, optimizing the service by creating the adapter on the backend is probably worthwhile.  If this weren&#8217;t the case, niche technologies like AMF wouldn&#8217;t even exist.  All services would provide XML loaded with every possibly usable property.</p>
<p>I agree with your last point that a layer comes in handy when integrating with services from various vendors. I just want to clarify that when I said an adapter layer should generally go on the backend, I did not mean it was okay to exclude some form of a service layer from the frontend.  It&#8217;s not.  I can see how that may have been interpreted though because adapter logic can be placed in the service layer rather than a layer of its own.  To explain how they relate in such a case, in most service layer implementations, there are interfaces (the object-oriented kind) that specify methods like getUser(), getOrders(), and getCustomers().  These are only the required method signatures, not the logic.  The developer then creates service-specific classes that implement those methods.  For compatibility with the AMF service, the developer would create a service class that implements the interface by providing logic for each of the required methods.  The logic in this class would be specific to AMF and <strong>may or may not</strong> include adapter logic (mapping a backend class to a frontend class).  Then the developer would create an XML service class that likewise implements the interface by providing logic for each of the required methods.  The logic in this second service class would be specific to XML and <strong>may or may not</strong> include adapter logic.  The existence of adapter logic in the XML service class is in no way dependent on whether the AMF service class has adapter logic within it.  With the service layer in place and the application calls a specific service (if we&#8217;re talking about the client) or responds to a specific request (if we&#8217;re talking about the server), the service configuration just points to the right service class and all the methods are implemented as expected.  So, when you say that any Flex framework should have some sort of service/adapter layer, they generally do have a service layer if they&#8217;re in any way related to Cairngorm, PureMVC, or just have a competent developer.  The frontend service layer is slightly different than the one I laid out though because its calls are asynchronous and therefore must also deal with result and fault handlers.  Other than creating classes to support a new vendor&#8217;s service (which may or may not include adapter logic), only small adjustments are needed to ensure flexibility with both.  In other words, having the adapter logic on the frontend doesn&#8217;t make the application more flexible with new service types, you have to make new service classes either way.</p>
<p>On a related note, almost all frontend <strong>and</strong> backend applications should have a service layer if they support service-related communication.  ASP.NET&#8217;s starter kit <a href="http://www.asp.net/Downloads/starter-kits/the-beer-house/" target="_blank" rel="nofollow">The Beer House</a> is a fantastic example of a flexible <strong>data access</strong> layer implementation where you can swap different kinds of databases and it&#8217;s seamless.  Although it&#8217;s for databases, the implementation for a backend <strong>service</strong> layer would be very similar.</p>
<p>Thanks for joining the conversation!  Keep it coming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-167</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 17 Sep 2008 20:37:26 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-167</guid>
		<description>A few thoughts:

(apologies in advance if your blog engine hates my HTML)


	
		Seems like any significant database changes are probably going to require a recompile anyway. If you&#039;re changing your data structure, it&#039;s probably for a new feature or something that&#039;s going to require a recompile anyway. If it really is insignificant, chances are you can wait to make it until the next release. For development this can be nice - I agree it&#039;s easier to have it server side in that instance - but I don&#039;t see this being a significant problem in a production setup.
	
	
		The converse advantage of a small SWF and faster SWF is that when the adapter logic is front-side, the core server-side engine requires less weight as well. Sometimes it even strips off an entire layer. The advantage here is that when you&#039;ve got thousands or tens of thousands using an application, sometimes a fat client is nice because you&#039;re using user CPU time rather than an (already taxed) server CPU that you have to pay for. There may be situations where a server performance boost is more important than a client performance boost.
	
	One other advantage to having client-side adapters in place is that the adaptation process makes more sense because it&#039;s already sitting in context. When you&#039;re typing or structuring data on the server side, classes (and their associated behaviors and attributes) have no meaning and can have confusing side effects due to server-side language constraints. When the adaption is happening client-side, those classes can be used better, and language-specific limitation (can&#039;t have &quot;delete&quot; as a property name, etc.) make more contextual sense.
	Generic data (adapted on the client-side for its own use) is more general purpose, and a single API method can serve multiple clients. If I expose a JSON or REST/XML API via the web, it&#039;s easy for a wide array of client applications to consume. Large data houses realize this and it&#039;s why you don&#039;t see a Flickr AMF feed - it&#039;s because *anyone* can use XML. There may be instances where other applications are using the same data, and building a parallel AMF layer doesn&#039;t make sense once you&#039;re already exposing that same data in a more general format (as far as typed data goes, at least).
	Finally, I think any Flex framework should have some sort of services/adapter layer, just to make use of a wider array of services available on the web. Sure, an in-house built app can (and often should be) AMF typed server side, but a layer client side will come in handy when you&#039;re integrating with SOAP/REST services from other vendors (Flickr, del.icio.us, etc.) or from a client doing their own services work in a non-AMF format. That way either side can adapt the data if it needs to.
</description>
		<content:encoded><![CDATA[<p>A few thoughts:</p>
<p>(apologies in advance if your blog engine hates my HTML)</p>
<p>		Seems like any significant database changes are probably going to require a recompile anyway. If you&#8217;re changing your data structure, it&#8217;s probably for a new feature or something that&#8217;s going to require a recompile anyway. If it really is insignificant, chances are you can wait to make it until the next release. For development this can be nice &#8211; I agree it&#8217;s easier to have it server side in that instance &#8211; but I don&#8217;t see this being a significant problem in a production setup.</p>
<p>		The converse advantage of a small SWF and faster SWF is that when the adapter logic is front-side, the core server-side engine requires less weight as well. Sometimes it even strips off an entire layer. The advantage here is that when you&#8217;ve got thousands or tens of thousands using an application, sometimes a fat client is nice because you&#8217;re using user CPU time rather than an (already taxed) server CPU that you have to pay for. There may be situations where a server performance boost is more important than a client performance boost.</p>
<p>	One other advantage to having client-side adapters in place is that the adaptation process makes more sense because it&#8217;s already sitting in context. When you&#8217;re typing or structuring data on the server side, classes (and their associated behaviors and attributes) have no meaning and can have confusing side effects due to server-side language constraints. When the adaption is happening client-side, those classes can be used better, and language-specific limitation (can&#8217;t have &#8220;delete&#8221; as a property name, etc.) make more contextual sense.<br />
	Generic data (adapted on the client-side for its own use) is more general purpose, and a single API method can serve multiple clients. If I expose a JSON or REST/XML API via the web, it&#8217;s easy for a wide array of client applications to consume. Large data houses realize this and it&#8217;s why you don&#8217;t see a Flickr AMF feed &#8211; it&#8217;s because *anyone* can use XML. There may be instances where other applications are using the same data, and building a parallel AMF layer doesn&#8217;t make sense once you&#8217;re already exposing that same data in a more general format (as far as typed data goes, at least).<br />
	Finally, I think any Flex framework should have some sort of services/adapter layer, just to make use of a wider array of services available on the web. Sure, an in-house built app can (and often should be) AMF typed server side, but a layer client side will come in handy when you&#8217;re integrating with SOAP/REST services from other vendors (Flickr, del.icio.us, etc.) or from a client doing their own services work in a non-AMF format. That way either side can adapt the data if it needs to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bryce</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-166</link>
		<dc:creator>bryce</dc:creator>
		<pubDate>Wed, 17 Sep 2008 19:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-166</guid>
		<description>Oh yeah.  Make the backend devs do all the work.  I hate doing extra work.</description>
		<content:encoded><![CDATA[<p>Oh yeah.  Make the backend devs do all the work.  I hate doing extra work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Ross</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-165</link>
		<dc:creator>Nate Ross</dc:creator>
		<pubDate>Wed, 17 Sep 2008 19:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-165</guid>
		<description>Nice article indeed.  In my experience, the only time the back-end and front-end developers need to collaborate is when the front-end data model is initially created and on certain occasions when the front-end developer needs additional data from the back-end.  

The benefits that I see are that if I am a front-end developer, I don&#039;t need to know the database schema!  I don&#039;t need to concern myself with why my classes are coming to me in a certain way due to associative classes, one-to-many relationships, inheritance, etc.  I can remain blissfully ignorant of the backend, and view it as a black box without having any understanding of databases, or backend coding conventions from Java or PHP.  Instead, I can simply focus on Flex or another front-end technology.  Due to the increasing specialization in our industry I think this is a huge benefit.

Thanks for the insights!</description>
		<content:encoded><![CDATA[<p>Nice article indeed.  In my experience, the only time the back-end and front-end developers need to collaborate is when the front-end data model is initially created and on certain occasions when the front-end developer needs additional data from the back-end.  </p>
<p>The benefits that I see are that if I am a front-end developer, I don&#8217;t need to know the database schema!  I don&#8217;t need to concern myself with why my classes are coming to me in a certain way due to associative classes, one-to-many relationships, inheritance, etc.  I can remain blissfully ignorant of the backend, and view it as a black box without having any understanding of databases, or backend coding conventions from Java or PHP.  Instead, I can simply focus on Flex or another front-end technology.  Due to the increasing specialization in our industry I think this is a huge benefit.</p>
<p>Thanks for the insights!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Allred</title>
		<link>http://aaronhardy.com/flex/the-why-what-and-where-of-custom-amf-class-adapters/comment-page-1/#comment-126</link>
		<dc:creator>Brian Allred</dc:creator>
		<pubDate>Sat, 06 Sep 2008 02:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://aaronhardy.com/?p=77#comment-126</guid>
		<description>Very well written, Aaron.  I agree completely.  The first three benefits of putting the adapter on the back end are very powerful benefits.  

It could be argued that if you&#039;re not going to put the adapter on the back end then don&#039;t bother doing an adapter at all--just deal with the raw data.

Really, the only valid reason for not creating an adapter and putting it on the back end is that the back-end developers might consider it to be a front end task to develop it, so the back end developers should not have to do it.  If that&#039;s their argument, then I think it&#039;s reasonable to request help from the front-end developers in creating it.</description>
		<content:encoded><![CDATA[<p>Very well written, Aaron.  I agree completely.  The first three benefits of putting the adapter on the back end are very powerful benefits.  </p>
<p>It could be argued that if you&#8217;re not going to put the adapter on the back end then don&#8217;t bother doing an adapter at all&#8211;just deal with the raw data.</p>
<p>Really, the only valid reason for not creating an adapter and putting it on the back end is that the back-end developers might consider it to be a front end task to develop it, so the back end developers should not have to do it.  If that&#8217;s their argument, then I think it&#8217;s reasonable to request help from the front-end developers in creating it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

