Service-Oriented Design with Ruby and Rails (Addison-Wesley Professional Ruby)

Category: Programming
Author: Paul Dix
4.2
All Stack Overflow 9
This Month Stack Overflow 6

Comments

by anonymous   2019-07-21

The best way to go for this is using messaging.If you don't know it's a technology for managing asynchronus services( aka apps).

It means that even someone you has lot of apps like you do messaging make them talk to each other, and if one of them break, the messaging technology will put the data on a queue so it'll not be lost.

There's several source of information for messaging.But first of all I advice you to pick Paul dix's book which is a major source of information to get start.

Also go to Rabbitmq which is one of the most advanced messaging technology out there.

But remember that your configuration will need much work upfront.But once it's done you'll cool.

That was my humble contribution.

Ps: I'm not an expert, as you I'm trying to implement this kind of architecture too.

by anonymous   2019-07-21

In my opinion the best way is using a Model. I suggest you this book

Service-Oriented Design with Ruby and Rails (Addison-Wesley Professional Ruby Series) [Paperback] http://www.amazon.com/Service-Oriented-Design-Rails-Addison-Wesley-Professional/dp/0321659368

If you are using RESTful with Database, the best practice is with a Model to better data control.

by anonymous   2017-08-20

Brandon Hilkert has been doing some posts about this topic. You can check them out here. There are also some books available on Amazon like this one. StichFix also created a gem to somewhat assist in this.

by anonymous   2017-08-20

In few words – an a very practical, non academic explanation – a RESTful web service is a web server that answer requests that are structured following a :resource/:action/[:id] pattern.

For example, your users are a resource and you have these actions:

  • GET /users : list of users
  • GET /users/5000/edit : Edit a specific user
  • GET /users/5000 : Show a specific user
  • GET /users/new : Form for creating a new user
  • POST /users/ : A post request that created a new user.
  • PUT /users/5000 : A Post request that updates an user.
  • DELETE /users/5000 : A destroy request that removes an user.

It is a CRUD interface: Create, Read, Update, Destroy.

Your sessions are resources too.

  • POST /session/create : Create a new session for a user.
  • DELETE /session/destroy : Removes a session.

Some resources do not need to be have all CRUD actions.

For the original document that describes the RESTful architecture:

http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

For a more practical examination of this matter:

http://www.amazon.com/Service-Oriented-Design-Rails-Addison-Wesley-Professional/dp/0321659368

by anonymous   2017-08-20

I recently found myself pondering similar questions, how best to modularise a large application. As a relative Ruby newcomer (< a year), I dabbled with writing Rails APIs, and consuming them with ActiveResource. It didn't feel quite right to me, Rails felt too bloated for the APIs and ActiveResource felt too generic and incomplete for the client.

Then, I read Service Oriented Design with Ruby and Rails - Paul Dix, and it was like an epiphany! It covers your specific question of pros, cons & the theory very early on (chapter 1 I think), and does it very well.