How does the portability of PureMVC benefit the application developer? - apache-flex

One of the stated goals of the PureMVC framework is to avoid platform dependencies in order to be portable. Considering that because of language and API differences application code will always be heavily dependent on the platform, and that avoiding platform dependencies makes the framework reinvent the wheel and/or only provide a least-common-denominator feature set, in what way does the portability of the framework benefit me as an application developer?

I've worked with PureMVC. They're trying to implement their stuff in quite a lot of languages. You may be right about the least common denominator, but overall, it's not a bad framework, and I've seen a really nice AS3 app in PureMVC.
I don't think they're talking about portability in terms of porting actual code. The idea there is more that you're using a generalized MVC architecture, which you could apply to other projects and other languages.
They're trying to say that if you become familiar with the PureMVC pattern, you could potentially come into a new PureMVC codebase, even if it's another language, and you would already know the lay of the land.
You might also say that developers who develop good PureMVC skills are likely to develop good habits which will translate as they go from language to language. But then again, maybe not.. for the reasons you mentioned.

We've been using PureMVC on two projects now and in my opinion the attempted language-independence is quite a burden.
The promise of jumping straight in a project because the framework is already know does not seem relevant to me if the languages are not already pretty similar (C# to java would make sense, as3 to php not) -- I agree that it is useful to have known ways of solving things, but for that the 'plain' patterns are good enough.
However, I also don't really agree with the usage of the various patterns the project uses, so our choice to not use it on the next project might be related to both issues, and not just the attempt at language/platform independence.

PureMVC's portability will help you when you migrate to or reimplement in another language.
I can't count the number of platforms and languages I've written code for that are now extinct and for which, even if I still had the source code it would be mostly worthless and have to be rewritten from the ground up today, since the code was usually 100% platform specific.
But all application code need not be heavily dependent upon the platform. View components and services (the boundaries of your application) will necessarily be, but your application logic which is sandwiched between the boundaries need not be.
The scope of PureMVC is really quite narrow; merely to help you split your code into the three tiers proscribed by the MVC meta-pattern. There is no reason why this code has to be tied deeply to your platform in order to be optimal.
When it comes time to migrate, you'll appreciate that the framework actors and their roles, responsibilities and collaborations remain the same. This leaves you to deal with syntactic differences of the language, recreating the view components and services. At least you won't have to completely re-architect.
And for the case of reimplementing in a different language, imagine you're trying to capture a significant part of the mobile market with your app. The market is so fractured, you'll have to implement the same program on 2 or more of Windows Mobile, iPhone, Flash, and Java. Sure you'll probably have separate teams in charge of the apps, but why have a totally different architecture? With PureMVC, you could have a single architecture for all versions of your application.
-=Cliff>

PureMVC is the only real option for Flash Platform developers who choose not to use the Flex Framework. For certain projects the size cost of Flex is too expensive (it happens!).
I like to prototype in Flex and then rip it out and replace my views with custom components when the application is near completion. PureMVC makes this really easy to do with it's Mediator pattern. I'm not sure there is any other framework that would allow me this workflow.
Personally, I think PureMVC went too far with it's portability goals: I enjoy that fact that it works with Flash AND Flex (for the reasons mentioned above), but feel that it should have stopped there, and made use of the native Flash Player event architecture.

Are there examples of people using PureMVC to build and port applications across multiple platforms?
My company is building a Flex application that we may need to port to other platforms:
Silverlight (likely)
Mobile (maybe)
Desktop (maybe -- not just AIR!)
TV sets (maybe eventually)
I am considering PureMVC as a framework if it can ease porting and maintenance. I am curious to know if other people have ported a PureMVC app to a different platform and what their experience was with porting and then having development proceed in parallel for the app on multiple platforms.
Cheers,
Karthik

PureMVC does not rely on a platform for its internal workings (Flash Events etc).
So, while it does not make porting any easier per-say, it can assist simply by showing us its friendly and familiar face wherever we may choose to go ;-)

Related

Can meteor.js web framework support a social networking architecture effectively?

So I'm new to node.js, javascript frameworks, and meteor.com. I'm trying to learn how to build social networks, and I'm naive/struggling to understand why Meteor.js (meteor.com) wouldn't be able to do all the great things you see now that twitter, facebook, instagram are doing?
There's the comet technology between client/server, authentication configs, asynchronous coding for scaling and performance, and built on top of node.js.
I'm trying to learn more about long polling, comet, gridFS or how files are stored, and in general things like replication sets, and sharding to help with performance (esp since Redhat has this openshift platform that we can build our own private clouds with).
I have some computer science background, but it seems like magic, so what am I missing? If you all could think of a few buzz words that make a social network tick that Meteor.js doesn't support, what would it be?
I hear things about parallel and concurrency (webworkers fixes that in part, no?), websockets, that high level languages like python or java are better off supporting. There's only one to learn my answers, and thats by doing, but thought someone could sway me one way or the other via this thread. Thanks!
This question encompasses a really broad idea and just focusing on using meteor alone would solve this issue. Here are a few points to consider:
I don't think this framework would be a good starting point to learn long-polling, gridFS, etc etc. Meteor aims to be a framework that tends to be more of an ecosystem of packages e.g. you can certainly roll your own aformentioned strategies -- however for dynamic updates, Meteor uses its own Data Delivery Protocol (DDP) supported/implemented by (surprise) a good bunch of core packages such as Spark.
Parallel processing and concurrency can be better off done using other languages, but why not with? Since Meteor is largely based on node.js, and node.js is really good with the aforementioned stuff plus it can play very well with other languages so you could integrate smoothly. Meteor doesn't really require you purely rely on it, as other languages would say the same thing. It's all in the general engineering / planning for your project. There are already lots of really good stuff out there that rely on Meteor, join in! don't be afraid. It all boils down to planning (and the courage/perseverance to pull it off, of course).
Right now, we cannot tell if Meteor would be incapable of the usual great stuff by gigantic websites. Sure, we can do live updates, (its own kind of) publish/subscribe patterns, and powerful stuff to boost development (look at the seven core concepts of meteor to best understand this). It is not impossible to replicate what is already out there, really. We can only say it with uncertainty at the moment mainly because.. (see next point)
The framework is so young! it's still at 0.6.x at the time of writing. Please take time to look at the Meteor Roadmap to see how things are going in terms of broader support for persistence/databases, performance considerations, and the official DDP specification.
I hope I have answered your enquiry (and more, I hope). I'm really excited for meteor myself as it could easily be the next big thing. We have a couple of (for-)production projects using Meteor as well, so you're getting direct insight from a person who has done quite a bit of hacking (and tons of research and first-hand experience) in Meteor. Not that i'm saying i'm an expert or so, it's just so much fun to work with Meteor and i'm totally not kidding you.
Hope this helps!
P.S.: Fair warning though, resources and documentation is really sparse at this point. I try to contribute to the community as much as I can about it (one of my starting points is here, on SO).

Advantages of using software framework

I was reading these days about large projects implementation in python and Flex, and very often people praise the use of framework (like Cairngorm, PureMVC or others) over traditional OOP coding.
I think i dont really understand the advantage of using FW, which is the strong point over classic programming? how big should be the project in order to use FW? it is intended mainly for web-applications? or can be used for desktop apps as well?
hope, all these doubts dont sound stupid to you, i am not Computer engineer, just electronic, so my knowledge of sw architecture is very limited.
Br
Using a framework is not really any different from classic OOP programming.
When you write projects in a similar environment, you will probably see yourself writing a framework (or a set of tools) over and over again.
A framework is really just code reuse - instead of you writing the logic for managing a common task, someone else (or you) has written it already for you to use in your project.
A well designed framework will keep you focused on your task, rather than spending time solving problems that has been solved already.
I would add my 2 cents here, using a framework will also help a better organized collaborative environment too. Your team mates will get to know about the code easily if you are following a standard framework.
In enterprise applications using framework helps meeting the deadline and better code quiality.

Flex Application Framework -- PureMVC Portability vs. Swiz?

My company is building a Flex application that we may need to port to other platforms:
Silverlight (likely)
Mobile (maybe -- iPhone: Objective-C , Android: Java, etc.)
Desktop (maybe -- AIR, .NET, etc.)
TV sets (maybe eventually)
Currently, I’m looking into application frameworks to build upon and I’m torn between pureMVC and Swiz.
I LOVE swiz for its simplicity and how it just gives you a way to hook things up and then apply your own patterns. From a flex-only perspective, this is my 1st choice.
But, PureMVC is platform-independent and has already been ported over to most of the platforms that are mentioned above. How valuable is this portability? Will it really make our lives significantly easier when it comes to porting and developing/maintaining multiple applications? If so, then it seems like PureMVC is the way to go.
Alternatively, since Silverlight has the most definite business case for porting of our application, maybe we could port Swiz to Silverlight? I'm not too familiar with which AS3 language and Flex framework features Swiz depends on and whether they are available in C#/Silvelright. Would this actually be possible?
Thanks so much!
Karthik
The way I see it, if you used pureMVC you could port to a new language, without too much trouble (other than what the new language will give you) your commands, mediators and proxies, provided you program your mediators to an interface, instead of a concrete component implementation, and the proxies use a services layer to get the data from server. That way you'll only have to implement the components and the service layer in the new language.
A quick look at the Swiz framework:
uses the flash event model (see CentralDispatcher)
uses some flash.net, and mx.rpc classes (see net and rpc swiz packages)
PureMVC framework doesn't use the flash event model, and eventual flash.net/mx.rpc references would normally appear in the service layer. On the other hand Swiz seems to be aimed at taking full advantage of flex, and the mxml format, so it might get the job done faster there. So you might also want to consider using Swiz for flex and PureMVC for the other languages.
Any framework, including Swiz, can very easily be ported to just about any language. Actionscript is touring complete, so theoretically any code writen in actionscript can be transformed into another touring complete language. For example, we use the Swiz framework in our mobile apps, which get cross compiled to run in iOS. There are many other open source cross compilers for a variety of languages, as well as Adobe's Alchemy project.
The only thing that is not easily portable in Swiz the usage of runtime metadata tags. This can be solved by using an advanced search and replace utility, or a custom transformation framework to convert custom metadata tags to their native code implementation. Hopefully we will see some cool new open source tools for this soon, now that Flex 4.5 was released with custom compiler hooks.
In short, I wouldn't even take portability into consideration when deciding on a framework. Choose the one which is most comfortable for you or your developers to use. I personally prefer Swiz myself.
Cheers!

Is Flex ready for prime time?

I'm working on a project that currently has zero users but we would like to scale up to potentially hundreds. Currently we are running on a MySQL database with AMFPHP interacting with Flex. We used Flex because of its robust graphic features (important to this project) and because the initial developer (not me) already knew ActionScript. We are currently using AIR but might switch to web-based Flash at some point.
My questions are:
Is Flex a good tool for a project like this?
What are the main limitations of Flex that we might encounter?
What are other development platforms we might want to consider?
Thanks.
- Dave
Short answer, Yes. There are already many prime-time Apps using Flex as their UI development platform. If you go to the Adobe site they showcase quite a few.
Speaking personally, I chose Flex for two reasons, first was that, although you probably can do much of what Flex does in HTML or with an appropriate toolkit, Flex is designed for attractive and compelling user experience and has available all of Flash. Plus the development environment and available widgets make it easy and fun to program. I don't want to spark a religious war about HTML vs. Flex, so I'll leave that there - it works for me and my application and customers.
Second, and more important, was that it balances the processing load more towards the client which means my server architecture can be optimised just for serving the content and persisting the data. Most of my business logic has migrated across to the client. Having spent many years in classical architectures I think this is a huge step forward, but I can already her a chorus of disagreement about that too.
My word of caution about Flex comes from needing to adopt the right architecture for your client code. It is pretty easy to create a huge and badly performing app with Flex if you get that wrong. Make everything event driven and apparently asynchronous and you should be OK ('apparently' because the Flash player is single threaded). And that is downside 1, the single threaded Flash player sometimes causes issues.
Downside 2 is perhaps more serious and that is locked down desktops in corporate environments. Quite often your target audience won't have administrative rights to their computer and will have either the wrong flash player or none at all. This is particularly true in public sector organisations and the military, so if you are heading there I would test carefully the presence of Flash amongst your users.
Other than that I heartily recommend Flex. It's also a great thing to have on your CV!
HTH
Flex has no inherent scalability problems, however if you have a graphic intensive application, proper serving of these resources might be a problem, but that has little to do with Flex.
The only note-worthy and likely platform you won't be able to run on is the iPhone (no flash) and some older non-flash mobile devices (although most support Flash-lite nowadays)
As for alternatives, if you are Graphics heavy, and don't mind the iPhone, then Flex is good if not best cross platform solution besides using pure HTML technologies, the trick here is HTML alone can do 99% of what Flex can do, but if your App requires the missing 1% then you're out of Luck, also Flex will reduce crossplatform and most browser compatibility issues. So it might make your work more productive.
Silverlight 2 is an alternative to consider. WPF if you're looking for something with offline support.
Yes, the scale and type of project
fits.
Immaturity of frameworks and libraries you might depend on. Immaturity of IDE's.
Silverlight, JavaFX.
Flex + AIR is probably as good a tool as Visual Basic was; it may be a better tool for having a much more flexible programming language and having free development tools, but keep the limitations in mind....
The main limitation I've seen from working with it is documentation. There seems to be not enough documentation, not good enough documentation, and not enough high-visibility work on it in the community. (This is coming from years in .NET; I've been constantly upset with how little MSDN says about methods but generally able to deal with it by finding the most useful blog posts.)
Other possible development platforms would depend very heavily on the specifics of the project. Web-based platforms bog down in deep, stateful interactions with data sets (even with nice AJAX libraries), whereas maintaining client-side installations of any thick client program (say, Flex + AIR) might be overkill if it's just a few CRUD forms.

Best performance comparison website or resource for .Net Web Applications?

I am the .Net specialist in a consultancy with many difference flavors of developers using many different languages and frameworks. Because everyone is pretty much trying to push their own agendas with our different clients in terms of what technology to propose, I'm constantly finding myself in the classic arguments with them all about "why" .Net may be a better technology solution for a given clients requirements.
Often time here, the debate comes down to the issue of performance. Usually the areas that are argued about here consist of costs, maintainability, and performance. I have a hard time arguing about cost because in general open-source technologies are usually cheaper, and although and can usual put a good word in for .Net in terms of total cost of ownership (It seems to be pretty easy to convince people that .Net applications have relative low costs for maintainability if the application architecture has been thoughtfully designed), we will really only push .Net here if the client understands and is indifferent about the costs associated with Microsoft licensing. In terms of maintainability, like I mentioned before, the other developers here realize how much a difference it can make when an application is thoughtfully designed. I have had around 8 years of experience programming .Net solutions and I'm pretty confident in my ability to present to a client all the features and tool sets that .Net provides to give an application a long, and easy to maintain life span.
So again, what it usually boils down to is an argument over performance. Up until now, I have worked for companies that already used Microsoft development technologies to developer their applications so while I have discussed performance with others in the past I have never been a position where I have had to convince performance. My other co-workers are always boasting about these different website that they go to that show improved performance for open-source web applications. This all being said, what I would like to know from everybody here is where do you usually go to get your information about how may some .Net web applications have out performed other technologies?
Thanks in advance for the advice,
-Matt
I appreciate the detail, though I must say I forgot your question at the end. =)
Anyhow, this is something that has certainly been on my mind in the past. There is always a conflict on what technology is the best. We all know on each side you will find zealots, so it's quite difficult weeding out the facts. Professionally, I've seen successes/disasters on both sides of the fence.
For you, since you have a vested interest in .NET. I would showcase success stories, such as ... (insert whatever big name site you want) Facebook, SO, etc. I'd also find stories where things went wrong on the .NET side and pinpoint the reason. Like you said, it is often poor implementation. I don't know how many DailyWTF stories I've seen with ASP.NET sites behaving poorly but it gets traced back to 1) Poor design 2) Implementation 3) Coding.
Once you have a solid show case to justify the technology you can then of course talk about your own past experiences. You need to qualify yourself as being able to avoid the same pitfalls that your stories exposed.
.NET loses in performance against C/C++. In general, it will win over Python, Ruby, and PHP in baseline performance. The static typing tends translates into faster native code. (There are exceptions, such as Python's hand-tweaked set() performance being faster than HashSets in .NET)
The difference might come down to things like apache vs IIS (and their respective caching configurations), database architecture, etc. Features than can be misused or misunderstood (ViewStates and large GridViews, or using large numbers of hidden WebControls, for example)
Depending on what type of application you are building I've found that performance is rarely an issue. All the technologies out there can perform well enough.
When debating .net versus java/ruby/python etc I usually try to point out other benefits of .net.
There was this one time my boss asked me why .net instead of others? He wanted to know because he could get a PHP programmer for cheap. As part of the report we wrote a simple web application in 4 different languages and the .net app ran the fastest by far. After that we solidified behind .net. This was when .net was new so none of us really knew it well. We came from ASP, PHP, Coldfusion and Java backgrounds.
If you are looking for .Net performance stories you can listen to this dot net rocks show

Resources