colinlin1982 / maashaack

Automatically exported from code.google.com/p/maashaack
0 stars 0 forks source link

The "hack" namespace #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We can add in the system package an internal namespace (public but special) 
to defines all secret properties in the class ?

We can choose the different names :

* lowkey
* inner
* underground
* secret
* arcane (nice name but used in the away3D framework)
* cryptic

Original issue reported on code.google.com by ekamel...@gmail.com on 27 Apr 2009 at 3:17

GoogleCodeExporter commented 9 years ago
names we can not use

 * system : will create conflict with the system package
 * core: will create confusion with the core package
 * standard, optimized, experimental: already attributed (see issue #30)

Original comment by zwetan on 29 Apr 2009 at 10:29

GoogleCodeExporter commented 9 years ago
we should also try to avoid shortenen names like: sys, std, etc.

the goal is to have a well named namespace

Original comment by zwetan on 29 Apr 2009 at 10:31

GoogleCodeExporter commented 9 years ago
we could do as mx_internal and use sys_internal which have a clear meaning but 
I 
would prefer a word in one block (hence no underscore use)

Original comment by zwetan on 29 Apr 2009 at 10:32

GoogleCodeExporter commented 9 years ago
yes :)

one block ! .. for me the _ is not very clean in a namespace or package name.
i don't like the shortcut names too.

Original comment by ekamel...@gmail.com on 29 Apr 2009 at 10:40

GoogleCodeExporter commented 9 years ago
I would use "hidden" instead of "secret"

if we want to make something a secret access 
[http://livedocs.adobe.com/specs/actionscript/3/wwhelp/wwhimpl/common/html/wwhel
p.htm
?context=LiveDocs_Parts&file=as3_specification114.html we could use this as3 
spec 
example]

Original comment by zwetan on 29 Apr 2009 at 10:51

GoogleCodeExporter commented 9 years ago
here some other names proposition

 * hidden: it can be of public use but hidden by default
 * hack (or haack): unlocking this namespace would be in most case a hack right ?
 * intrinsic: synonym of internal but that we can unlock

Original comment by zwetan on 29 Apr 2009 at 10:55

GoogleCodeExporter commented 9 years ago
here a use case

1) a class take a LoaderInfo to get the URL from it
2) in the unit tests we want to override by hand this URL
3) but you can not create a new LoaderInfo() with an arbitraty URL

so one solution is to have a "hidden" setter that define a rawurl

hidden function set rawurl( value:String ):void
or
hack function set rawurl( value:String ):void
or
intrinsic function set rawurl( value:String ):void

Original comment by zwetan on 29 Apr 2009 at 10:57

GoogleCodeExporter commented 9 years ago
"intrisic" is a good name but is used in AS2 with the intrinsic core class.

I prefere "hidden" is a good name :)

Original comment by ekamel...@gmail.com on 29 Apr 2009 at 11:01

GoogleCodeExporter commented 9 years ago
I like "hack" :)

2 reasons
 * well we are named maashaack =)

 * look how it is used

----
package system
{
    public namespace hack;
}
----
import system.hack;

package
{
    public class Test
    {
    private var _url:String;

    public function Test( info:LoaderInfo )
    {
        _url = info.url;
    }

    public function get url():String
    {
        return _url;
    }

    hack function set url( value:String ):void
    {
    _url = value;
    }

    }
}

----
import system.hack;
use namespace hack;

var test:Test = new Test( null );
    test.url = "http://www.mytest.com";

----

Original comment by zwetan on 29 Apr 2009 at 11:09

GoogleCodeExporter commented 9 years ago
ok to use hack :) with the Maashaack name it's ok for me :)

Original comment by ekamel...@gmail.com on 29 Apr 2009 at 11:21

GoogleCodeExporter commented 9 years ago
I can implement it today if you want :)

Original comment by ekamel...@gmail.com on 29 Apr 2009 at 11:21

GoogleCodeExporter commented 9 years ago
sure :)

Original comment by zwetan on 29 Apr 2009 at 11:26

GoogleCodeExporter commented 9 years ago

Original comment by ekamel...@gmail.com on 29 Apr 2009 at 11:42

GoogleCodeExporter commented 9 years ago
Fixed in the revision 689 :
http://code.google.com/p/maashaack/source/detail?r=689

Original comment by ekamel...@gmail.com on 29 Apr 2009 at 11:47