¡@

Home 

2014/10/16 ¤W¤È 12:07:08

jquery Programming Glossary: responsibility

Why would one use the Publish/Subscribe pattern (in JS/jQuery)?

http://stackoverflow.com/questions/13512949/why-would-one-use-the-publish-subscribe-pattern-in-js-jquery

jquery design patterns publish subscribe share improve this question It ™s all about loose coupling and single responsibility which goes hand to hand with MV MVC MVP MVVM patterns in JavaScript which are very modern in the last few years. Loose coupling.. in the last few years. Loose coupling is an Object oriented principle in which each component of the system knows it ™s responsibility and don ™t care about the other components or at least tries to not care about them as much as possible . Loosing coupling..

backbone.js - getting extra data along with the request

http://stackoverflow.com/questions/5711245/backbone-js-getting-extra-data-along-with-the-request

share improve this question Generally you need to handle this in the collection class' parse method. Its responsibility is to take the response and return back an array of model attributes. However you could do more than that if you wished.. However you could do more than that if you wished if you didn't mind the parse method having this additional responsibility. UserList Backbone.Collection.extend model User url ' users' parse function data if data this.registered_users 0 return.. just use the built in hook method that you have. Purists would say that you are giving the parse method a secondary responsibility which might surprise some people e.g. returning something and modifying model state . However I think this is okay. share..

How to use Twitter Bootstrap popovers for jQuery validation notifications?

http://stackoverflow.com/questions/8439490/how-to-use-twitter-bootstrap-popovers-for-jquery-validation-notifications

can't figure out where that hook is or even if one exists in either validation engine. They both seem intent on taking responsibility for displaying notifications with all kinds of elaborate options for placement wrappers styles when all I'm after is the..