Where goes the business logic?
That depends on two factors: Where the application runs and by whom.
In the open world (think of public web sites like Gmail), you won't be able to put business logic (aka the model) on the client for obvious reason (mostly security and intellectual property).
The problem you are faced with is that your programmers have to switch between two implementation languages. On the one hand, they need to develop in a server-side language (such as Java, Ruby, Python, PHP). On the other they need to deal with often vast amounts of Javascript.
If you target older web clients, your application might even need to degrade smoothly (being non-Web2.0ish). Which means that your developers will have to implement features twice. Once on the server, once on the client. With the beautiful side effect of increasing testing complexity exponentially.
However.
In closed corporate environments you can often define new rules. Take this customer, for example.
- centralized administration through Citrix
- authenticated and authorized clients only
- new applications replace internal applications only, nothing externally visible
- client wants developers to focus/specialize on one language
So what did we do?
- application interface uses Mozilla XUL
- JS business objects represent part of the model
- the rest is implemented in Cobol (legacy base of +1M LOC)
- JS framework abstracts everything (DOM manipulation, data entry validation, RPC, dynamic trees, datagrid)
- simple data entry applications even do SQL from the client
Advantages
- time-to-market: the app prototype is the final app
- powerful widgets made usable with less logic
- teams specialize and become more productive
- targets Mozilla, so it is portable across operating systems
- handles local files (e.g. importing Excel spreadsheets)
Note that we have abolished being compatible with other browsers. Our Application Platform is Mozilla.
Posted by Sascha Schumann
at
17:58
| Comments (0)
| Trackbacks (0)