GIGJ.COM
welcome to my space
X
Personal Injury | Languages | Soups | Photography | Email | Prepress | Exotic Locations | Computer Games | Related articles
Search:  
Welcome to:gigj.com
NAVIGATION - HOME
Use of namespace
Published by: mike 2009-01-07

  • Tcl Built-In Commands - namespace manual page::
    the contents of a namespace over time using a series of namespace eval commands. You can use the namespace which command to clear up any question about
    http://www.tcl.tk/man/tcl8.3/TclCmd/namespace.htm
    HOME
    I read the tutorial about the usage of namespace but I didnt undertand it.
    1. Ext says that namespace is useful to avoid creating global variables or classes, right?
    2. So if I do the next:
    Ext.namespace("MyClass");
    MyClass= function(){
    this.variable=.......
    XML Namespaces::
    When using prefixes in XML, a so-called namespace for the prefix must be defined. The namespace is defined by the xmlns attribute in the start tag of an element.
    http://www.w3schools.com/xml/xml_namespaces.asp
    HOME


    }

    MyClass is not a global function?

    Thanks


  • Namespaces in JS are simulated, they're just nested objects.

    1) Yes
    2) Yes
    3) Correct


  • I read that the namespace is for avoiding to override classes with the same name like the next example:
    #81 (Problems with use default namespace public) – ECMAScript Bugs – Trac::
    If I add use default namespace public inside the !MathInternals package, and in a context where P.f is an import, or using ns::f for some dynamic value of ns.
    http://bugs.ecmascript.org/ticket/81
    HOME

    Ext.ns("MyClass");
    Ext.ns("HisClass");

    MyClass.subclass1= function(){
    ....
    }

    HisClass.subclass1= function(){
    .....
    }

    1. I have two classes ("subclass1") named equal but with different namespace, right?
    2. All declared in the form MyClass.something would be local to the namespace MyClass, right?
    3. Its like declaring packages in java? tries to simulate this?


    Thanks


  • Only the top-level namespace becomes a global variable, e.g.

    Ext.ns('MyNamespace.subns');
    MyNamespace.MyClass1 = function() {...};
    MyNamespace.MyClass2 = function() {...};
    MyNamespace.subns.MyClass3 = function() {...};


  • For example if I do:

    Ext.namespace("MyClass");
    MyClass.subclass1= function(){....}

    1. MyClass would be global but MyClass.subclass1 wouldnt, right?
    2. If I wouldnt use Ext.namespace(....), MyClass.subclass1 would be global, right?
    3. Why wouldnt I want MyClass.subclass1 to be global?

    Thanks


  • 1) Yes
    2) No
    3) That's the whole point of using a namespace, so you can separate out your code and not pollute the global namespace.

    Say you did

    Ext.ns('Foo.Bar.Baz');


    It's equivalent to

    Foo = {};
    Foo.Bar = {};
    Foo.Bar.Baz = {};





  • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
    Busy Friday Leads to Strong Close for Net Stocks

  • christians according to your faith which is more offensive to your faith paganism wicca or atheism
  • what is the problem with my phone no msn
  • so how do you as a christian say your eyes upon your mate is holy and single
  • who believes the most foolish man in the bible was solomon
  • which is sadder to watch it die or never to have known it
  • what is your opinion on christians smoking marijuana
  • why do you as a christian say i do not use jesus to get into heaven
  • do you think the christians are like judas
  • so christians what is the difference between one in the flesh and gods love not in the flesh or the world
  • how can i find a cheat for minesweeper msn
  • does it say anywhere in the bible about the holy spirit breathing inside you
  • if god knows everything that will ever happen then why does he get mad
  • can all christians leave a answer using the bible about in heaven can we have
  • hello my brothers and sisters in christ could you kindly help a new member here
  • how do you interpret revelation 14 lamb and the 144 000
  • if jesus died for our sins wouldn 039 t that make us all murderers
  • do you think that jesus is too old
  • spiritually speaking hitler got banned from yahoo answers
  • boxers under boardshorts
  • what does it mean that no vulture eye will find this path
  • christians explain how jesus christ is the savior
  • is this the proper teaching of jesus christ and the meaning of life
  • why are msn and hotmail the same
  • where does it say in the bible about jesus telling the disciples to wait for the holy spirit
  • what do you think this vision means
  • who seeks for the faith and the gifts of miracles and healing and walking on water for all of the holy spirit
  • strangers and pilgrims on the earth were did the journey start with you
  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Use of namespace , Please add it free.
    About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008gigj.com All Rights Reserved