define(
// require.js dependency injection
[
  'shared/mock/module'
],

// require.js module scope
function(module) {
  'use strict';


  module.factory(

    // factory name
    'BookmarksCollection',

    // factory dependencies injection
    ['DataStore', 'Helpers', '$log',

  // factory definition
  function(DataStore, helpers, console) {

    console.debug('BookmarksCollection');

    /*
      options = {
        name: '',
        objType: '',
        indicesArray: ['id'],
        fn: {
          searchValue: function(data, find) {},
          init: function( collection ) {}
        }
      }
    */
    var collection = DataStore.create({
      name: 'bookmarks',
      objType: 'Bookmark',
      indicesArray: ['id', 'name'],
      fn: {
        searchValue: function(data, find) {

          if(!find) return [];

          var r = [], obj,
              regexp = new RegExp(find, 'i'),
              len = data.length;

          for (var i = 0; i < len; i++) {
            obj = data[i];

            if(obj.name.match(regexp) || obj.description.match(regexp))
              r.push(obj);
          }

          return r;

        },

        init: function( collection ) {

          console.log( 'init bookmarks' );

          var seq = 0;

          function createObject(_id, _name, _description, _url) {
            return {
              id: _id,
              name: _name,
              description: _description,
              url: _url
            };
          }

          collection.insert( createObject(seq++, 'Twitter - Erko Bridee', '@ErkoBridee', 'https://twitter.com/erkobridee') );
          collection.insert( createObject(seq++, 'GitHub - Erko Bridee', 'github/erkobridee', 'https://github.com/erkobridee') );
          collection.insert( createObject(seq++, 'Delicious - Erko Bridee', 'delicious/erko.bridee', 'http://www.delicious.com/erko.bridee') );
          collection.insert( createObject(seq++, 'Site - Erko Bridee', 'Site : Erko Bridee', 'http://about.erkobridee.com/') );

          function fakeUrl() {
            return 'http://google.com/#q=' + seq + '%2B' + seq;
          }

          for (var i = 59; i >= 0; i--) {
            collection.insert( createObject(seq++, 'fake bookmark ' + (seq+1), 'some description to fake bookmark ', fakeUrl()) );
          }

        }
      }
    });


    function BookmarksCollection() {}
    var ClassDef = BookmarksCollection;

    ClassDef.prototype = collection; // extends
    ClassDef.prototype.constructor = BookmarksCollection;
    ClassDef.prototype.sayMyName = function() {
      return 'Angular.js Mock BookmarksCollection';
    };

    var instance = new BookmarksCollection();
    console.log( instance );

    console.log( instance.list() );

    return instance;

  }]);


});

@@ -1213,25 +1213,25 @@
 ( 'init 
-b
+B
 ookmarks
 ' );%0A%0A  
@@ -1222,16 +1222,26 @@
 ookmarks
+Collection
 ' );%0A%0A  
@@ -2376,24 +2376,32 @@
 lection() %7B%7D
+%0A%0A    /*
 %0A    var Cla
@@ -2429,17 +2429,16 @@
 ection;%0A
-%0A
     Clas
@@ -2527,32 +2527,114 @@
 arksCollection;%0A
+    */%0A%0A    var ClassDef = helpers.extendsFn( BookmarksCollection, collection );%0A%0A
     ClassDef.pro
@@ -2694,12 +2694,9 @@
 .js 
-Mock
+:
  Boo
@@ -2711,16 +2711,21 @@
 llection
+ Mock
 ';%0A    %7D
@@ -2773,16 +2773,17 @@
 tion();%0A
+%0A
     cons

use helpers.extendsFn