JavaScript developer looking for inspiration from frameworks such as cocoa - cocoa

I'm a developer who builds mainly single page client side web applications where state in maintained on the client-side. Lately some of the applications have become very complex with very rich domain models on the client-side and increasingly complicated UI interactions.
As we've gone along we've implemented some very useful design patterns such as Passive View MVC, Observers, bindings, key-value observers (cocoa). I have recently got a lot of inspiration from the work of SproutCore and Cappuccino which are both JavaScript web frameworks inspired by Cocoa.
Obviously all of the problems that developers are having now in building complex web applications have been solved by desktop developers many moons ago. As few months ago all I knew about Cocoa was that is was some Apple thing, now it has had a big impact in the way I develop my web applications.
I was wondering if anyone who has more experience in building desktop GUI's than I, could point me any other frameworks out there which may also give me inspiration in terms of design patterns and structures to use for my JavaScript web applications?
I really don't care what languages or platform these frameworks reside in, as long as they can teach me something about good application design in general.

Fowlers GUI Architectures seems to be a reasonable survey done at a high level, I don't know how complete it is, however.

Have you taken a look at Cappuccino? It's a Javascript client-side framework, very heavily inspired by Cocoa. The Cappuccino creators even wrote their own Objective-C runtime in JavaScript so that Cappuccino apps can be written in Objective-J, an Objective-C-like syntax for JavaScript.

Related

Xamarin cross-platform user experience vs. native development

I am trying to evaluate whether Xamarin would be a good option for my project. The project is a large, complex app for Android and iOS with a lot of client-server communication. The user interface is a major focus and has to be really fast and smooth. Also, we plan to make large use of UX graphic effects (comparable to the Spotify app).
For now we are planning to go for two separate native apps using Java/Objective-C. However, the possibility of cross-platform code sharing would be very convenient for us of course.
Most opinions I've heard so far say that Xamarin - although far better than HTML5 apps - cannot match the UX of a native app. Also, I tested the following applications made with Xamarin (on Android):
Rdio
MarketWatch
Busch Gardens Discovery Guide
Sqor
Storyo
From my impression, none of them could quite match the speed and smoothness of a good native app.
If our focus is on a top notch user experience, would Xamarin really be a viable option? Can it really match a native UX? I am particularly looking for opinions from developers who have experience with large and complex cross-platform Xamarin applications. A few critical voices would be very helpful.
Thank you a lot!
I'm on the Rdio mobile development team, so I can make some personal reflections from that standpoint.
Xamarin allows you to write native applications in C#. Any slowness, jankiness, ugliness or bad-appiness usually has nothing to do with the Xamarin layer itself.
You save some time being able to share core business logic between your different clients, but you're still writing the UI from scratch, specific to the platform. You're just writing it in C#.
But while you save that time, you're spending it in other ways. All of those SDKs you want to use probably aren't compatible with Xamarin out of the box. You won't be pod install'ing that iOS framework, and you might be reinventing the wheel for handfuls of things. Xamarin takes advantage of the NuGet repo so you have a library of components that handle many of the things most people need (Analytics, Testing, Facebook SDK, JSON parsing, Database, etc etc) but it doesn't cover everything. And it certainly doesn't cover stuff that's out the day of an Apple or Google product announcement.
Any 3rd party code that you do want to import into your project will be done through writing custom bindings. While not usually difficult, it is time consuming. Xamarin has a team of people that specialize in assisting you in this. This fact speaks to the process being messy at times.
So while the slowness, jankiness, ugliness or bad-appiness probably isn't the fault of Xamarin, it might be the fault of you spending time in places you normally wouldn't, or not being able to take advantage of features you normally would. If that 3rd party partner SDK is giving you problems, your troubleshooting may take twice as long because there's a layer that you don't control.
UI is a wash. You're writing it from scratch anyway.
Business logic is shared. Depending on the app that might be a win if you architect your application to take advantage of it.
Compatibility / bleeding edge ability will be lacking. That might not matter to you at all, or you might be the person wanting to take advantage of that hot new API in the next OS release the day it's announced.
My personal thought, without knowing specifics, is if you want to build an application that you plan on being around years from now, and that will take advantage of the latest and greatest, I'd tell you to write natively for each platform. Unless you can really see huge gains in sharing that business logic the upfront gains are minimal. Or if you really like C#.
Xamarin uses native controls. So you design a fully native UI per platform. The users can't see that your App is made with Xamarin or Java/Objective-C.
There are sometimes performance issues in conjunction with the platform independent UI wrapper Xamarin.Forms. But you're not forced to use it. When you have still performance issues in your Xamarin.Android or Xamarin.iOS app then you produce them in your code.
There are benchmark results for Android apps comparing Xamarin.Android and Java apps: Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?
As you can see Xamarin's internal performance became better and better over the time.
Conclusion: Yes, you can write smooth native Apps using Xamarin.

Can the Model View Presenter be used in a native desktop application?

I'm just starting out on GWT, and I came across the MVP (was actually trying to get ahead of myself..get a little motivation). I already have a desktop application that I want to modify, can a desktop application use the MVP? and if the answer is no, what components and or classes can be used to simulate having a model view presenter?
You cannot compare GWT and MVP: they are totally different things.
GWT is a toolkit that allows you to write desktop-like web applications in java.
Some years ago, Ray Ryan from google gave a talk at the Google IO where he presented an effective pattern to code web applications using GWT. This pattern is MVP. It was not invented by google, it was already there. It's just fit for purpose when you come to write desktop like web applications. At least, this is what Ray Ryan proposed in his talk.
As far as I know there are 2 most famous implementations of the MVP in GWT: Acticivties and Places (Google) and GWTP (Arcbees). You can also create one yourself as exercise, it is not too complex. The main concept is having the view as dumb as possible and put all the business logic in the presenter. The View and the presenter collaborate through an interface. Ok, easier said than done, I'll give you that. But you can google for more.
So yes, you can write a desktop application using MVP.

Capuccino alternative with a comparable looking UI?

I'm looking for a set of Javascript based UI components for a web app I'm building and have found that many of the best looking web apps were built with the Capuccino framework; see http://www.getflow.com/, http://www.picsengine.com/home/ and http://timetableapp.com/ for examples.
However, I'm not a Cocoa developer and have no interest in learning Objective-J. Ideally, I'd find a set of components that provide the visual end result of Capuccino apps without the underlying weight of the framework.
I have seen the Aristo jQuery UI them (http://taitems.tumblr.com/post/482577430/introducing-aristo-a-jquery-ui-theme), but jQuery UI just doesn't seem to have the depth of components available in Capuccino.
I realize this may be a long shot, but I figured it can't hurt to ask. :)
Thanks.
As another option, there is jQuery UI: nice if you are already familiar with jQuery, with the plus side of not being too heavyweight, but may not have all the components you need pre-defined. A nice thing is that it encourages to write the HTML in a way that degrades gracefully when your application in older browsers.
Maybe sproutcore is an alternative for you, although it requires you to hand-code everything in javascript from scratch. It offers most basic components and is easily adjustable to your personal design goals. Sproutcore is used in Apples Mobile Me and in some other big projects.
Another possibility might by vaadin which offers a rich set of prebuild controls and is based on Googles GWT javascript compiler. But it only makes sense if you are developing in a java environment.

Which are the J2ME MVC frameworks?

I have to do a quite big project in J2ME for school.
I didn't used 'till now J2ME, so are there J2ME MVC frameworks
for which I can find books or at least very good online tutorials?
MVC is what I'm looking for because we have to do unit testing and
I'm familiar with MVC from ASP.Net MVC, Rails and Grails.
So, any good framework to use with this project?
We are developing this project for Blackberry cells.
With Java you don't really need a framework, creating MVC-based apps is just about using the principles correctly, so having controllers dictating the response to any action and so on. I'd think about using Observers to help by having your views observe your models and controllers observe your views (to get events and so on.) Unit-testing this then becomes quite simple.
If only, the fact is that every handset is very different - its extremely difficult to build an app that spans all the major J2ME-capable handsets that looks half way decent by following the basic principles. Which is why we end up doing things like using sprite based fonts (ugh). I don't think I've ever worked a mobile project using J2ME where we've managed to stick to just the standard J2ME (and, we try very hard). Even things that should be standard, like reading a JSON feed from a server, persistent storage or even really simple things like sprite rotation is really not very standard at all (yes, I'm looking at you RIM). And, then throw a requirement for Android into the mix and you're done.
I've used Polish, and its really very good. Commercial license is not cheap (but worth it), but for a school project its free. Flash (cough) is also a good alternative too. These days, personally, I find my projects need to span iPhone (Objective-C), Android (Java), Nokia (J2ME) and Blackberry (pseudo-J2ME) and it gets real tricky to not use a commercial framework (or roll your own, if you've the time and inclination). I'm open to ideas for frameworks that span all those platforms?
I'm not sure anything like this exist, as mentioned by previous poster, you just follow the principles of the pattern. However, look at J2ME Polish, it's a very nice framework which makes your life with mobile java much easier. Particularly strong features they offer is the usage of CSS for displays - this gives you pretty good "V" part in MVC pattern.

Choosing between Ajax, Flex and Silverlight [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Ajax, Flex and Silverlight are a few ways to make more interactive web applications. What kinds of factors would you consider when deciding which to use for a new web application?
Does any one of them offer better cross-platform compatibility, performance, developer tools or community support?
Here's a quick rundown of each area (with lots of helpful links):
Cross-platform compatibility
Ajax works in any modern browser that can run JavaScript. Flex requires Flash or anything else that can handle SWFs but, once that's installed, it's a total freeride as far as compatibility. Silverlight is tricky and misunderstood so carefully consider your userbase before going with this MS foray into the rich web applications arms race. Also keep in mind that Silverlight is still in Beta, so it may become more widely used and installed in the future as it is developed.
Performance
I'm fearful of making too many statements about performance because it really depends on how much you are willing to optimize and the exact nature of your application. Also, some technology stacks are just never going to be very fast. Some people out there have been making comparisons, but again, it depends on a great many factors (even the version of the browser from which you are testing!). It's probably best to choose based on other factors and optimize once you've started to develop.
Developer tools
There are the "golden standard" dev tools for each of the three:
Ajax has basically unlimited options, depending on the rest of your technology and architecture choices. The big questions you're actually faced with are which libraries to rely upon, and Google has voiced a pretty well adopted answer with things like Web Toolkit. When you get right down to it, it's just XML and JavaScript, right?
Flex is from Adobe and, just like with Flash development, you'd better stick with their homegrown tools because--well--they're making the standards as they go along.
Microsoft has positioned Microsoft Expression Blend versions 2.0 and 2.5 for designing the UI of Silverlight 1.0 and 2 applications respectively. Visual Studio 2008 can be used to develop and debug Silverlight applications (from Wikipedia).
Community support
There is both official and unofficial community, corporate, and open-source support for all three options. Whichever you are already integrated with and which makes you feel most at home are very individual things, but I'll offer this advice: stick with what you know. If you are a MS developer and have MSDN as your homepage, you are probably going to think the Silverlight documentation and forums are really helpful. Flex has a very similar story; the forums are pretty good and if you're a Flash person already, you're going to be right at home with their documentation and user community.
On the other hand, Ajax is basically all over the place because you can implement so many different ways and use so many widely-varied libraries. Each library can have it's own forums to visit and mailing lists to lurk within for answers.
Once again, all three have corporate giants trying to foster their communities and to get the best support possible to the developers that will give them greater market share in the future.
The choice should in my opinion be mostly based on the nature of the application you'll be building (for example, if you need to manipulate vector graphics, Ajax is pretty much out), but here are some general guidelines:
Ubiquity
Ajax -- Supported by all modern browsers across platforms
Flex -- Runtime (Flash Player) has very wide installed base for Windows, Mac OS, Linux. Linux version was a bit buggy the last time I checked, though
Silverlight -- Runtime has quite low installed base (and no Linux support) at the moment
Choice of programming language
(Unordeded because of subjectivity, but note that Silverlight offers the most choice. Also note that the existing language experience of developers in your team should be taken into account.)
Silverlight: Any .NET language (C#, Visual Basic, IronPython(?), IronRuby(?)) (and XAML for UI definition)
Ajax: JavaScript (and XHTML for UI definition)
Flex: ActionScript 3 (and MXML for UI definition)
API Stability and compatibility
Flex -- Runtime is the same across platforms and browsers, more mature and stable at the moment than Silverlight
Silverlight -- Runtime is the same across platforms and browsers, less mature than Flex/Flash, v2.0 is still in beta
Ajax -- Compatibility problems across browsers (may be mitigated via Ajax libraries, though)
Web/Browser Integration
Ajax -- Content is native inside browser, based on standards: searchable by browser and search engine crawlers, subject to any standard UI practices the browser and operating system have established
Flex and Silverlight -- Content not native to browser (i.e. runs in its own little "sandbox/rectangle"): not necessarily subject to established UI practices for the given platform
Developer Tools
Ajax -- Your favorite code editor, browser and debugging toolkit for the browser
Flex -- Flex SDK is available for Windows, Mac OS and Linux for free and can be used with your favorite code editor. A Command-line debugger is included, but the Adobe-provided profiler is only available in the commercial Flex Builder IDE
Silverlight -- AFAIK, The SDK is available for Windows for free and can be used with your favorite .NET development tools
The web runtimes like Flex and Silverlight all offer enticing things, but come with two big costs:
They run only within a rectangle on the page, and don't interact with normal web widgets
They are only available to people who have that plug-in installed
Even the nearly-ubiquitous Flash isn't installed on every web browser, so by choosing to use a plug-in runtime you're excluding part of your audience.
In contrast, JavaScript (or Ajax) is available on pretty much every browser, and interacts better with normal web pages, but is a more primitive and restricting language. Using it for complex animations can be tricky, and you'll need to test your applications in more versions on more platforms to make sure it works.
Cross-platform compatibility isn't the issue it used to be, so the issue is this: Will you gain more in the features of a plug-in library than you'll lose in the audience you exclude?
My own answer has so far always been JavaScript/Ajax, but I'd re-evaluate that in any new project.
What is your audience: public web site or an intranet business app? Adoption rates are not relevant if you have a controlled audience who will install what is needed to run your app. However, if you need the largest possible audience to make your web startup a success then it may be critical.
What is your goal? Building something for the lowest cost? Learning new technology?
Can you leverage your existing skills? If you already know .NET then Silverlight gets a boost. Learning Flex may be interesting and useful, but is it more useful to you than more experience with .NET technologies? Remember to consider the opportunity cost of learning something totally new.
I don't see a clear technology winner at this point, and likely there won't be one for a long time, so the choice will come down to fairly subjective factors.
Other than what's already been mentioned here, another huge thing to consider is what your UI is going to be.
If you're going to be using a lot of advanced UI controls like trees, lists, tab controls, etc then consider the following:
JavaScript/HTML - No native support for anything beyond things basic drop down boxes, buttons, and text fields. If you want something like a tree control or tab control then you'll have to roll your own or find a third party library.
Adobe ActionScript - Native support for a wide array of advanced UI controls
Silverlight - 1.0 had very limited UI controls, but 2.0 will be adding many more and I'm sure we'll continue to see controls added in future releases.

Resources