# Model based on remote Web Services instead of DB

**URL:** <https://www.ruby-forum.com/t/model-based-on-remote-web-services-instead-of-db/106994>\
**Category:** Rails\
**Created:** [June 16, 2007, 7:58am UTC](https://www.ruby-forum.com/t/model-based-on-remote-web-services-instead-of-db/106994 "2007-06-16T07:58:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![murtada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@murtada](https://www.ruby-forum.com/u/murtada)\
**Post date:** [June 16, 2007, 7:58am UTC](https://www.ruby-forum.com/t/model-based-on-remote-web-services-instead-of-db/106994/1 "2007-06-16T07:58:56Z")

</div>

Hi,

I am accessing a web service that sends me a list of events. My local  
ROR application is an events website.

What is the best way to integrate these? If I were to have a local DB,  
I would just create a model, controller etc. Is it possible to keep  
such a structure, and just have the model retrieve data from the web  
service instead of the local DB?

Thanks.

Murtada

---

<div class="post-metadata">

**Author:** ![murtada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@murtada](https://www.ruby-forum.com/u/murtada)\
**Post date:** [June 16, 2007, 9:44am UTC](https://www.ruby-forum.com/t/model-based-on-remote-web-services-instead-of-db/106994/2 "2007-06-16T09:44:04Z")

</div>

There is nothing in controllers and views that assumes active record  
for the model, and the model knows nothing about the other 2. That is  
what separation of concerns is all about. You can build model classes  
any way you like. The classes should provide some form of class level  
methods the controller can use to get started servicing a request. It  
may or may not return instances of the “model” class, or just data in  
other forms like hashes and such.

Michael
