Sean Fights Back
Sean (the Architecture "guru" from MM) doesn't agree with me about MX, but he doesn't seem to understand what I was saying, so I will try to explain a little better this time :-).
1. Why is Flash remoting bad?
Flash remoting isn't bad. It isn't like Macromedia made a horrible implementation. The problem is that remoting doesn't scale (you yourself point this out in your own article). .NET does not require me to use remoting. ASP.NET lets me keep all my logic on the same machine. But you say, HTML isn't a rich client? So? For most web apps, you don't need a full blown rich client. If you do, use WinForms.
2. Why is the CFC facade a bad thing?
Facades are generally used to accomplish two things:
a) make a system easier to use
b) decouple client implementations from the server
A CFC based facade that requires you to pass around name value pairs throughout your UI layer hardly accomplishes (a) or (b). All you have done is create a thin, non-functional layer over your nice OO system. And why did you do this? It wasn't for (a) or (b), it was for performance. Ok, fine. I can justify that, but what I can't justify is having to write a big facade layer every time I create an application. The very thought reeks of architecture maleficence. Solving all your latency issues on the server side is a pretty lame idea. If the client is doing the talking, the client should solve at least a few of the latency issues (it is a "rich" client...right?).
Why should I use an actionscript based facade? How 'bout so I can implement things like caching? How 'bout so I can use the object oriented priciples I was trained to use? How 'bout so I don't have to spend countless hours remembering what property is associated with what key? How many apps that you've helped design over at Macromedia pass all their data around the UI layer as one big associative array? I hope none. And why not? Because it is a stupid idea and anyone lame enough to design a system like that would be fired on the spot. Why then do you recommend that the clients using your product design their systems in such a fashion?
Additionally, by creating a rich object model on the client side (via actionscript), you can solve both (a) and (b). Let us take this contrived example:
class Person
{
[property] string PhoneNumber;
}
in your name value pair collection, you would represent this with the key "PhoneNumber" linked to a string.
Now, what happens when you want to support multiple phone numbers? If you have a nice class structure, you just change the class like so:
class Person
{
[property] PhoneNumberCollection PhoneNumbers;
}
Then, you take your implementation of PhoneNumber, mark as obsolete if you want, and make it point to PhoneNumbers.Primary. Walla! Now, if you were using fields, it becomes a bit more difficult to update your client side code. What choices do you have? Not many. You can add a phone numbers collection linked to a "PhoneNumbers" key. A key linked to a collection is shady business though, and you also have another problem. If someone changes the PhoneNumber value, the primary phone number in the collection is not updated, and vice versa, big sync problems emerge.
Take it a step futher, you need to implement security on top of the properties. Only certain people can set a the phone number property (say, only adminstrators). How do you ensure this if everything in an associative array? Well, you could just check on the submit to the server, but performance blows there and someone debugging their app doesn't find out until after it has been submitted, you should be able to warn them immediately. If you have a class based layer written in Actionscript, you can take appropriate actions to ensure that the call to the server is never made in the first place and that the developer knows exactly what caused the error.
Now, you might say, but that isn't a facade, it is a full object model! Who the hell said that your facade had to be a thin, non-functional, flattened view of your backend systems? How does that accomplish (a) or (b)? If anything, you could save yourself the trouble of having all those extra properties / objects on the server side and pass datasets back and forth to the client, which wraps their data in nice, easy to work with objects for you.
The main objection from most devs is really going to be, but that is going to take way too much actionscript to accomplish! Yes, they are right and that's exactly my point.
3. Isn't the point of .NET that I can use multiple languages in a solution?
No, the point of .NET is productivity. The fact that you can use multiple languages in a solution does not mean you should. In fact, it is a last choice solution, usually reserved for people first transitioning to .NET that don't have time to get there VB UI programmers and C++ guys all working in the same language and meet their deadline. Don't most UI guys know Javascript anyway? No. Web guys, probably (though I've seen a lot of incompetent web guys), but it isn't a requirement. Additionally, understanding javascript and being proficient in it are two completely different things. Can I use client side Javascript with .NET? Yes. Do I have to? No! Can I use client side javascript with Flash? Yes. Do I have to? Yes.
4. Isn't MX Studio just as integrated as VS.NET?
Lol. Give me a break. It is a heck of a lot more like the integration in Visual Studio 6. It is there, but only slightly. In VS.NET I never have to leave the IDE. If I want to add an event handler, just double click and it is added. If I want to do this in MX, I have to do quite a bit more work (click ui component, find event handler property, type in name of event handler, switch to actionscript editor and enter event handler name exactly as I entered it in flash, etc.). Is this difficult? No, but multiply by 100 and you have a time consuming load of repetition.
This isn't even to mention that ActionScript editing support in Flash is very poor, and that is why everyone serious uses .as files and third party editors outside of the IDE anyway. Can you imagine a .NET developer using VS.NET for the UI layer and jumping to sharpdevelop for their coding?
Sharing a .as file is hardly the equivalent of having a solution under source control with the aspx.cs files. I can step through the entire project line by line, in and out of layers, all from VS.NET. An AS file without the associated FLA is pretty useless for debugging.
"Our developers use Dreamweaver MX for pretty much all our code - both client and server - using Flash MX as the visual UI creation IDE and compiler. To me, that doesn't seem like "two entirely different IDEs" (since they share a look and feel and are well-integrated)."
LOL. I don't care what it "seems like," making two applications look the same hardly makes them integrated.
Now, if you want to talk IDE's, what about extensibility in the MX suite? Where is the System.ComponentModel? Where are the VSAs? Where are the UITypeEditors and ControlDesigners? Can't find them in MX? That is because they don't exist. What to extend design time dehavior for a control or add some functionality to the IDE. Good luck. First, you have to sell your sole away to Macromedia and then they will give you a crappy SDK that doesn't even compile and tell you to figure out how to use it (how do I know? because I've seen the SDK and witnessed it not compiling, and then crashing when it finally did compile). What about if you want to extend VS.NET? Just head over to MSDN and you can find a plethora of info without ever signing a licensing agreement or trying to get someone else's shody code to compile.
5. How does Actionscript promote spagetti code?
Well... let us see... why don't VB or C# have include statements? Why does MX? It isn't that you can't create relatively clean code inside of MX, but that it is a lot harder. For one, you have to leave the IDE and put your code in an .as file, this step alone leads to spagetti, because most people aren't going to use it, and those that do will have to hunt down all the include statements to find out where this code is actually getting run from.
6. But code behind requires you to be multi-lingual...
What are you talking about? For someone in charge of architecture at MM, you seem to know very little about your competition. The ASPX file is declarative, it doesn't contain code (and, if you embed code, it can be in C# or VB or whatever language you are using in your code behind file).
"How or why is that better than writing business logic in ColdFusion behind Flash's ActionScript front end?"
Because no one uses ColdFusion for serious development. But the cold fusion argument is a whole different topic now isn't it...
7. What are the limitations of flash?
Well...you asked for it....
a. Lack of true component based programming model (see: System.ComponentModel, System.ComponentModel.Design)
b. Lack of WebService support (see: WS-Extensions for Microsoft.NET)
c. Lack of XML suport (see: XPath, XSTL)
d. No declarative programming support (see: Attributes, ASPX templates, ASCX templates, HTML)
e. JavaScript is the most powerful language you can use in your UI layer
f. Javascript is the only language you can use in your UI layer
g. Lack of framework support (see: CLR, BCL)
h. Lack of standard support at the file format level (see: ISO, ECMA, vs. crappy non. compiling discontinued SWF SDK from Macromedia with very poor documentation)
i. Slow as molasses (see: Macromedia redesigns site with MX and ticks off their customers)
j. ByteCode format significantly lacking (zero support for class definitions, metadata, etc. at the bytecode level, see: SWF File Format Docs vs. CLI docs)
k. Lack of Enterprise level support (see: System.EnterpriseServices)
l. Lack of RAD tools
m. Macromedia doesn't listen to community (see: director of architecture ignores valid points about the limitations of Flash...or this article or this article by some people more involved in the Macromedia community).
Don't get me wrong, I think flash is a very cool tool, and I would love to use it in my projects! However, these are some of the reasons I can't use it as much as I would like to. When John Dowell (from MM support) notes that he can't tell me anything Macromedia is doing to solve these problems and Mr. Corfield ("the director of Architecture at Macromedia") tells me they aren't real problems at all, I get the feeling that I won't ever be using flash for any serious development... very sad feeling, since I would very much like to use it. Oh, well... I guess I will just wait on SVG instead :-).