What's
Leturn is JS framework completely based on OOP. As we know, normally, it's unreasonable to implement a fully OOP substantially in Javascript. Especially, it's so more and more because there is no accessor for a parent class on the inheritance relationship and encapsulation and interface are also impossible in current Javascript. However Leturn is trying to access doing conceptually. In other words,it is to access and understanding of the development methodology right side not with or without the possibility according to the features and technical support. In addition, the final direction Leturn aims is to provide useful web component-sets. Through this, it's blueprint of the ideal and goal that ever will help to be possible to develop web applications faster. In addition there are many excellent and highend-grade frameworks for Javascript currently. I don't recommend using Leturn of them, If you want to use this for the easier and more convenient to handle, controll and access them of elements in a web page. In short, it may not be a proper imposition of easy-to-use. Of course, Leturn also provides the base functions as such, but it is only provided because they are basic foundation to implement a complex big thing. Therefore, naming of majority framework members of Leturn are not short because it is a natural process to avoid naming-duplication of members when proceeding the inheritance and increasing intuitive of OOP. In addition, in order to perform one of the largest it avoids thoroughly the situation provided that is integrated in one place. For example as for scrollbar, so as to provide it for a developer, it can put all the features into a one class but so in that case, it only just looks like OOP apparently shown, his role is not different from the general function library. The scrollProvider and the interface scrolling for it are separated for the effective reproduction by the related class of Leturn because a slider has a similar design with scrollbar. And required drag object is also divided. AshAPI that the initial version of the Leturn framework was begun in 2007 was developed based on the event and class modeling of AS3.0 from first development timing. Everything is thoroughly the class consists of a base, in canvas element case it can be a good example for the introduction of AS3.0 modeling in Leturn. Leturn은 OOP와, 클래스 정의 및 멤버 구성 이벤트처리 및 네이밍에서 AS3.0모델링을 기반으로 하기때문에, 웹요소에 대한 빠른핸들링과 간편한 작업에는 적합하지 않을수 있다. 간편한 작업보다, 복잡하고, 실제 구현하기 어렵거나 귀찮은 부분들, 그리고 대규모 프로젝트에서 확실하고 유용한 웹콤포넌트셋을 제공하여, 이를 체계적으로 관리하고, 좀더 나은 잇점을 제공하는것이 최고의 목적임으로, 쉽게 사용하는 간단한 네이밍보다, 직관적이고, 구분이 확실한 구조를 우선시한다. 또 재사용과 향상성을 중요시하기 때문에, 구조를 도식화하고 이를 클래스화하며, 설계할때 번잡함이 따를수 있지만, 방대한 코드들에 대한 중복을 최대한 피함이 최우선 원칙임으로, 실제 많은 Asset들에 비해 코드의 크기는 상대적으로 적을것이다. 만약, 일반적이고 일상적인 작업들을 위한 웹요소의 빠른접근과 조작이 최우선일경우 이 프레임웍은 적합한 대안이 아닐지 모른다.
Version History
[2011.11.28] : ver 0.31 - DOM Core Modeling / EventDispatcher ( Base on AS3.0) [2013.11.19] - Remove all the arguments.callee & rebuild Class chain. - Reconstruct the integrated info from ASHCONFIGS in this version. * JSON is offered in a light version due to some reason if browser does not support Native. therefore, you may need to use it for considering it case in ie9 below. [2015.03.18] - Support Promise Object [ECMA6]. it's the absolutely same with the native object in using and compatibility and very lightly polyfill version (ie6 ~ ).
Rebuilding Concept
ver 0.31에서 사실 지난 AshAPI (2007년) 초기 구상시 처음도입되었던, EventDispatcher모델링과 클래스 상속관계를 제외한 나머지부분을. 클래스패키지개념으로 접근하면서, 많은 부분에서 개선을 이루었지만, 0.31은 API가 글로벌영역( 내부함수로 감산형태가 아님 )으로 코드시작이 구성되었기 때문에 클래스정보를 제공하는 부분을 var 키워드로 선언하면서, 인터널로 숨길수가 없었다. 결국, var를 선언하면, 해당 api를 불러올때 window영역으로 모두 잡히기때문에. 그러한 정보들을 ASHCONFIGS안으로 가져가고, 이것을 생성되는 클래스개별로 모두 개별 배치할수 밖에 없었다. 문제는, 자바스크립트 자체는 퍼로퍼티의 은닉자체가 있을수 없으므로, 실제 이러한 정보들은, 비공개임에도 불구하고, 공개가 되거나, 요즘 코드디버깅이 너무편리한 브라우저에서 개발자나 사용자가 본다면, 쓸데없이 공개되는 정보들때문에, 실제 클래스에서 필요한 속성들과 혼란이 있을수 있다는것이다. 또, 이러한 부가정보들은 Function 자체에 expando로 확장해서 쓸수밖에없는데, 사실 자바스크립트 자체가 Dynamic 셋팅이라, 모두 호스트객체로 처리되어 사용자정의변수들을 마음대로 부여할수 있다고 하지만 바람직한 형태는 절대아닌것이다. 어쩔수 없이 static으로 선언해야하는 점들을 제외하고 말이다. 해서, 이러한 부분들을 해결코자, 0.77에서는 클래스정보들을 internal객체로 위임하고, 해당 ashInternal은 외부에서 한번 감싼 함수내에 선언된 로컬타입이기 때문에 window영역으로 빠지는 고민을 해소하며, 개발자나 사용자가 쓸데없이 봐야하는 불필요한 정보들을 해당클래스에 셋팅할 필요가 없는 장점을 제공한다. 또 이번 버젼에서는 클래스에 대한 정의, 클래스가 가진 모든 static, member 메서드에 대한 모든 정보들을 internal code로 표시도록 개선했으며, for in 루프에서 사용자가 속성을 참고코자 할때, enumerable 설정으로 표시되지 않도록하여, 위에서 언급한 추가적인 혼란이 생길수 있는 부분을 사전에 방지토록 개선했다. 그 외, 각 클래스를 직접 함수로 호출할때, 개별적으로 설정할 수 있는 constructorExcutingFunction 기능도 함께 추가하고, 2008년부터 ECMA-262 deprecation 권고사항이 되었던 arguments.callee 적용을 모두 삭제시켜 그 어느때보다 더 완성도 있는 API를 셋팅하도록 만전을 기했다.
Rules of Leturn Class-Chain Definition
Leturn의 네이밍 즉, Leturn클래스 패키지를 기반으로 도식화 할때( 주로 Core클래스들 )는 다음 규칙이 반드시 필요하다. Leturn이후 (모든 하위 notation포함) 대문자로 시작되는 변수는 클래스를 의미하며, 소문자는 static 변수/메소드를 의미한다. 더불어, 모든 네이밍이 전부 대문자와 언더바로 연속된 변수들이 나올때는 이것은 상수이다. 이러한 법칙들은 기본적으로 클래스인지, static 메소드인지 모호해질 우려가 있음을 근본적으로 방지키 위한 규칙이다. 물론 소문자로 처리하더라도 동작상에는 문제가없지만 이렇게 처리해야한다. 또, 도식화에서 구조적으로 하위에 클래스가 정의되었다 하더라도 이는 상속관계에 반드시 유효하다고 생각하면 안된다, 말그대로 기본적인 그루핑에 대한 정의일뿐. 상속관계와는 무관하다. 물론 구조적 위치와 상속관계를 유지하는 클래스도 있다. ※ 물론 Leturn 네이밍의 도식화 기반이 아닌 var myClass = Leturn.createClass( null, ... ) 처럼 구현할때는 이러한 규칙을 준수할 필요가 전혀없다. 예를들어
Leturn.Element
Leturn의 구조적 위치 (패키지개념)인 하부 클래스 HTMLElement 의미 (0.31버전에서는 Leturn.HTMLElement 였지만, Element로 변경).
Leturn.Element.Canvas
HTMLElement 및에 다시 구조적 하위인 Canvas의미 (물론 이것은 상속관계도 포함).
Leturn.Util
Util 클래스의미.
Leturn.Net
기본 네트웍 처리에 대한 클래스 의미.
Leturn.Net.Xhr
네트웍 처리 하위 클래스 XHR 클래스 의미 ( 하위 클래스에 지정되었더라도 Net 클래스와 상속관계를 포함하진 않는다.)
Leturn.VERSION
Leturn static 상수.
Leturn.createClass
Leturn static 메소드
Leturn.browserInfo
Leturn static 변수
Leturn.Element.getDocument
Leturn.HTMLElement의 static메소드인 getDocument 을 의미.
Leturn.Element.Canvas.WebGL
Canvas하위패키지 개념으로 WebGL을 클래스지칭.
  Leturn.External.CustomClass 이경우, 최종 CustomClass를 생성하는 시점에서 Leturn.External.CustomClass의 전체경로 중간에 Leturn.External 이라는 클래스가 생성되어 있지 않을경우 자동으로 External이라는 Anonymous의 빈 익명클래스가 생성되고 이 클래스는 Leturn을 상속받은 클래스가 된다. 이러한 생성은 오직 createClass로 클래스를 생성하는 시점에 자동으로 구현되기 때문에 만약 Leturn.External이란것을 강제적으로 Leturn에서 static 변수로 생성하고, 혹은 리터럴 변수로 할당했을때 생성시점에 아마 오류가 발생할지도 모른다. 따라서 반드시 위에 열거한 룰에 기반하여 동작을 처리해야 한다. ※ 참고로 Leturn.Element 으로 명시했다고해서, OO개념으로 HTMLElement은 Leturn을 상속했다고 생각하면 안된다. 이것은 패키지개념으로 각 클래스를 참조할 수 있는 경로상의 관계를 의미하는것일뿐 실제 다른 위치에서 상위클래스를 상속할 수도 있다. 이를테면, Leturn.Element는 Leturn.EventDispatcher를 상속하고 있는데 이는 위치상 같은 레벨의 포지션이기 때문이다. 네이밍 도식화와 상속관계가 같아야 한다면, Leturn.EventDispatcher.Element가 되어야하는데 이것은 직관적이지 못하다. 즉, 이것은 상속관계의 개념보다, 같은 성격을 그룹핑한 패키지 개념으로 이해하는것이 더 맞다.