I’m thinking about building an application with a RESTful web service. My thought is to build the RESTful (json, etc) part of the application as a standalone, and then the frontend (e.g. html/css/js/etc) as a client to that service, although not through js, I’d like the web page to work without js, so probably using something like LWP to make the calls. Basically the result is 2 separate apps. Is this a bad idea? good idea? I realize this is somewhat subjective.
I’m thinking about building an application with a RESTful web service. My thought is
Share
I think it’s a good idea.
It means that at the end of it:
You’ll have a full API with at least all the functionality of your native graphical interface. So you won’t end up with any functionality in your graphical interface that is not available as a service.
You’ll avoid some duplication of effort, because all the effort you go to in order to get the graphical interface working properly will also be reflected in the web service because they use one and the same function. Fix a bug in one and it is fixed for the other.
This also means there is consistency.
Automated testing is potentially easier.
It’s good to keep things modular especially in open source as it makes it easier for someone to then go out and write a separate graphical interface to your service, or even to modify your service while using the same graphical interface.