Ruby on Rails Monday, August 25, 2014


You will almost always find that as your mobile app and web app grow you will require changes to the API. This is why a versioned API enable you to not worry about crippling old mobile clients and move new clients onto the new versioned endpoints. 

It may be temping to just to "re-use" the existing Rails controllers -- and may in fact be the way to go if your app is small --  but in a large app this gets very messy very quickly. 

Also if you are "re-using" the existing Rails controller because those controllers contain domain logic, then you should refactor your domain logic out of the controllers and into domain objects. Building more controllers actually encourages you to do this, which in the end creates a cleaner architecture (although I would caveat that it may be more work up-front).

-Jason



On Aug 25, 2014, at 10:42 AM, André Orvalho <andreo@benjamin.dk> wrote:

  Well It's more like a question for the future. If I need a app to start with, is it a good practice to still do the website and use the common API or to just develop the app?


No comments:

Post a Comment