Reputation:
I've been working on a project that uses Flex + Blazeds + Spring. Now some parts of it must run offline due to connectivity issues. The problem is how to deal with the existing architecture, preserving it as much as possible, or at least how to create a solution not too much hard to evolve. I've seen many similar questions searching on the internet, but the most common approach is writing all code in actionscript(including business logic, access to database, transactions and so on), what I particularly don't consider suitable for the case. I'm thinking of using Jetty embedded in the application and some kind of embeddable database such as Java DB, so I could access my Spring services normally without any big change. Some workmates, however, disagree. They think that a web server running on a client's machine can lead to performance issues and a more lightweight solution is the way to go. Until now, no other solution came up. What do you suggest?
Upvotes: 0
Views: 142
Reputation: 11912
Of course I do not know your concrete case, but in general I would agree with your colleagues. Especially if you wouldn't like to provide helpdesk services for your users 24/7. Performance may indeed be an issue if your users don't have powerful machines. I know Jetty is pretty lightweight, but on some older computers, you want to have as few processes running at the same time as you can.
But what I would be more concerned about, is the maintainability of your application. For starters, you'll have to get the whole stack installed on the users machines, which won't be easy. Once you've got that covered, you have that many more points of failure. Your application can now fail in the AIR app, in the local server, in the database or in the connection between one of those layers.
If you think the server you'll deploy on the local machines will behave a 100% in the same way your current web server does, you're probably wrong. You're not running Jetty or an embedded DB online, are you? Your users may have all kinds of different operating systems which you have to account for.
How are you going to push updates to your application? This is a pretty simple procedure in an AIR app, but it's going to be a lot harder if you have to also update the local server-side code.
I reckon in the long run it'll pay off rewriting some logic inside your AIR app. It will cost you some up front, but it'll cost you less in maintenance. I also don't think that the complete model should be rewritten. With these kinds of online/offline problems you can develop a strategy where you synchronize only the most important data. And if you dislike the code duplication, you can always write a generator that can take your Java model and create ActionScript duplicates.
Upvotes: 1