5

I'm completely lost and apparently have fall way behind with regards to my web services. In my current applications I perfer simple ajax calls on .asmx files. With my latest work I'm trying to implement backbone.js and would like to use the models in conjunction with some RESTful web services.

I know I could override the sync function of backbone but I would really like to utilize it with some .net webservices.

Has anyone done this before and might have an example of how, I can't find an example or tutorial anywhere to even point me in the right direction. If anyone has any ideas on where I should start.

i can't seem to add a comment but I will be using JSON

2
  • Will you be using XML or JSON? Commented Dec 9, 2011 at 14:53
  • Forget about built-in methods and variables, write your own methods instead. After that you can call any web service and save the result in any way as you want. Commented Dec 9, 2011 at 18:27

1 Answer 1

1

I would not bother with the backbone synch, don't go overriding it, it will be to tricky to hack in whatever you need.

build your own ajax calls to the webservice with callback functions, that put the returnvalues in models or collections via the model.set(attributes, [options]) && collection.reset(models, [options])

Sign up to request clarification or add additional context in comments.

5 Comments

Right, I know this is an option I am just trying to see if I can get it functioning within the already built backbone architecture.
while i understand your point of view if you say you are trying to test the limits of backbone, or want to learn something on customizing the synch, i doubt using the built in functionality will get you where you want to without risk and in due time. so if it were a project for a client i suggest to do it yourself, if it's a hobby project of which you want to learn as mutch as you can on backbone, by all means try the built in functionality first :), i just gave you a way out for when you really need it :)
@Sander I think he wants to use the built in functionality just doesnt understand how it works. Maybe? Am I right?
@MikeFielden Correct I DO want to use the built in functionality if possible
@colin, i said before it was possible but the huge changes required to make it work are in my opinion not worth it. I am in no way stating it is impossible or anything

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.