Results 1 to 2 of 2

Thread: Object Factory that creates object factories...

  1. #1
    Join Date
    Jan 2011

    Object Factory that creates object factories...

    Hi all,

    I'm stumped on finding a way in javascript to create an object factory whose instances are also object factories. In short I want something like that below, but no joy ... any clues?

    function createClass () {
    return new createClass()
    function createClass() {
    return new createInstance ()
    function createInstance () {
    //Default properties, values and methods which might later be extended

    var createDoor = createClass();
    var door1 = createDoor();
    var door2 = createDoor();

    var createChair = createClass();
    var chair1 = createChair ();
    var chair2 = createChair ();

  2. #2
    Join Date
    Feb 2003
    Michigan, USA

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles