Dmitry Sheiko's Web Development Blog

Dmitry Sheiko's Web Development Blog

Already a Member? Log In to Your Account
Dmitry Sheiko's Web Development Blog
Added: June 10, 2010
Authority: 42.5476
Type: Blog
Language: English
Ranking: N/a
Category: Programming
  Analytics :: more
Latest Posts :: more

Prototypal Inheritance in JavaScript for Modules

The classical design of object in JavaScript may look pretty clumsy. So I prefer the module design propagated so indefatigably by Addy Osmani (addyosmani.com/largescalejavascript/). We keep all the declarations within the function body. Public members placed in the object, which the constructor function returns. It looks much nicer. But, here shows up a problem. Common implementation for inheritance doesn't work on such objects. Let's study how exactly JavaScript instantiates objects and come up

Dependency Injection via Factory

You know, when coupling is not loose, components depend too much on each other. It makes your entire architecture fragile and immobile. You can check how loose the coupling is by making a unit test for a component. If you have no problem substituting dependencies by e.g. mock objects then everything is ok. Let take a model class. It depends on DB connection, here Lib_Db_Adapter_Interface instance. We cannot just create DB adapter instance within model constructor, because it depends on configura

Design by Contract and JS

Design by contract (DbC) is an approach in application design, which originally came from Eiffel, but now widely used on different languages (particularly in Java). In real world one party (supplier) makes an offer for an agreement (business contract) and another one (client) accepts. The same way can be described relations between objects in software engineering. As a declared agreement is accepted by the client object, the last one is expected to keep its rules



  Related Blogs
Language: English
Language: English
Language: English
Language: English
Language: English
Language: English
Language: English
Language: English
© 2006-2012 OnToplist.com, All Rights Reserved