JavaScript MVC (마이크로) 프레임 워크가 있습니까? [닫은]
클라이언트 측 JavaScript MVC (마이크로) 프레임 워크가 있습니까?
다소 복잡한 HTML 양식이 있으며 MVC 패턴의 이점을 누릴 수 있습니다.
좋은 솔루션이 다음을 제공한다고 생각합니다.
- 값이 변경되면 모델 및 뷰가 컨트롤러를 업데이트합니다 (Observer 패턴)
- 페이지가로드 될 때 양식 데이터에서 모델을 채 웁니다.
- 모델이 변경 될 때 모델에서 양식을 채 웁니다.
Ajax, 혜성, JSONP 및 모든 재즈는 심각한 과잉입니다.
백본은 매우 가벼운 프레임 워크입니다. 시도해보십시오 : http://backbonejs.org/
JavaScriptMVC 는 훌륭한 솔루션입니다. 플러그인 접근 방식으로 필요한 기능 만 선택할 수 있습니다. 2.0부터는 jQuery를 기반으로합니다.
JMVC는 개발을위한 중간 계층 만 제공하므로 웹 사이트를 점진적으로 향상시키는 것은 사용자에게 달려 있습니다. 디자인 선택을 직접하는 것은 사용자의 책임입니다.
그러나 JavaScriptMVC는 강력한 이벤트 위임 기반 컨트롤러로 인해 최고의 범용 JavaScriptMVC 라이브러리입니다.
이벤트 위임을 사용하면 이벤트 핸들러를 첨부하지 않고도 페이지에 대한 규칙을 만들 수 있습니다.
마지막으로 JMVC는 MVC 아키텍처 그 이상입니다. 여기에는 개발주기의 모든 부분이 포함됩니다.
- 코드 생성기
- 셀레늄 및 Env.js 통합 테스트
- 문서화 엔진
- 자동 Concat + Compress
- 오류 감지 및보고
Spine 에는 Backbone과 비슷한 API가 있지만 훨씬 작습니다. 프로토 타입 상속이 특징입니다.
AngularJS는 jQuery와 함께 잘 작동하며 MVC 구조와 엄격한 우려 분리를 통해 많은 도움을 줄 것입니다.
전체 테스트 환경 및 의존성 주입 포함 ...
http://angularjs.org 에서 확인하십시오
실제로 : http://www.javascriptmvc.com/
나는 당신이 이것으로 충분하다고 생각합니다!
나는 이것이 당신이 체크 아웃해야 할 것처럼 보인다고 생각한다 : http://knockoutjs.com/
(silverlight / wpf 프로그래머로서 이것은 마침내 자바 스크립트를 배우기 시작한 라이브러리였습니다. 현재 VMV (Model-View-View-Model) 패턴을 기반으로합니다. 지금은 좋은 선택 인 것처럼 보입니다!)
인기있는 Backbone.js가 있습니다
다음은 Ember를 즐겁게 사용할 수있는 세 가지 기능입니다.
- 바인딩
- 계산 된 속성
- 자동 업데이트 템플릿
바인딩
바인딩을 사용하여 서로 다른 두 객체 간의 속성을 동기화 상태로 유지하십시오. 바인딩을 한 번만 선언하면 Ember가 변경 사항이 어느 방향으로 전파되는지 확인합니다.
두 객체 사이에 바인딩을 만드는 방법은 다음과 같습니다.
MyApp.president = Ember.Object.create({
name: "Barack Obama"
});
MyApp.country = Ember.Object.create({
// Ending a property with 'Binding' tells Ember to
// create a binding to the presidentName property.
presidentNameBinding: 'MyApp.president.name'
});
MyApp.country.get('presidentName');
// "Barack Obama"
바인딩을 사용하면 MVC (Model-View-Controller) 패턴을 사용하여 응용 프로그램을 설계 한 다음 데이터가 항상 계층에서 계층으로 올바르게 전달된다는 것을 쉽게 알 수 있습니다.
계산 된 속성
계산 된 속성을 사용하면 함수를 속성처럼 취급 할 수 있습니다. 계산 된 속성은 다른 속성과 마찬가지로 바인딩 작업을 수행 할 수 있으므로 유용합니다.
자동 업데이트 템플릿
Ember는 시맨틱 템플릿 라이브러리 인 Handlebars를 사용합니다. JavaScript 애플리케이션에서 데이터를 가져 와서 DOM에 넣으려면 값을 표시하려는 위치에 태그를 작성하여 HTML에 넣으십시오.
<script type="text/x-handlebars">
The President of the United States is {{MyApp.president.fullName}}.
</script>
Full disclosure: i'm the author of this library :)
If you're looking for something really tiny (1.5kb minified / gzipped) have a look, and tell me if you like it.
If your requirements are really simple, you could write your own simple MVC like Alex Netkachov did.
His examples are built on dojo (Note: they don't work for me on his page because of a missing dojo.js file), but you could follow the pattern in plain Javascript.
It's probably overkill for what you need, but SproutCore is an MVC framework, and it doesn't look any more heavyweight than JavaScriptMVC or TrimPath's Junction.
Unfortunately, none of these seem to be built on the principle of progressive enhancement.
The popular ActionScript MVC framework PureMVC was recently ported to JavaScript. I haven't had a chance to try it out yet, but I am confident it's good.
Please also checkout jquery-claypool.
jquery-claypool is a small, fast, railable mvc framework built on jquery, based on my experience with django, rails, spring etc. Its very light weight and runs on both on the client and in server environments.
it provides a routing framework for clean mvc, category logging, filters (aop), lazy creation of controllers, inversion of control, convention-over-configuration and not much more by design.
it doesn't do anything jquery already does, feels like jquery, and works like a good framework should: simply.
Hope you check it out.
Jamal is the lightweightest I've seen. It's also based on jQuery (bonus). Have not used.
If you want to keep things under control and quite simple, you may don't need a framework, but just implement your own mvc pattern. Just check this article: Model-View-Controller (MVC) with JavaScript by Alex Netkachov on 2006.
Here is a list of all open-source JavaScript Frameworks known to mankind.
http://getopensource.info/explore/javascript/framework/
Or only MVC frameworks
http://getopensource.info/explore/javascript/mvc/
Disclosure: I'm the developer of this website.
Try kitty. It is only 1.4KB and its only dependency is EJS.
UPDATE 2016: Sammy.js seems to be abandoned.
Have a look at Sammy.js
Text from the site:
A small webframework with class.
- SMALL Sammy's core is only 16K compressed and 5.2K compressed and gzipped
- MODULAR Sammy is built on a system of plugins and adapters . Only include the code you need. It's also easy to extract your own code into reusable plugins.
- CLEAN The entire API was designed to be easy to understand and read. Sammy tries to encourage good encapsulation and application design.
- FUN What's the real point of development if its not enjoyable. Sammy tries to follow the MATZ approach. It is optimized for developer happiness.
I wouldn't call this a micro-framework, but it sure looks interesting: Cappuccino Web Framework
CorMVC, easy to understand and to start with, jquery based and does not depend on any server technology
I have developed a very simple Javascript MVC framework called MCV. It does not do exactly what you ask for, but it is easily extensible with helpers. Anyway, it is definitely micro (1,9kb packed).
It works more or less like Jamal, but I decided to roll my own for two reasons:
- remove the jQuery dependency (although I use it together with jQuery most of the time)
- making it extensible with helpers. These are analog to CakePHP behaviors, components and helpers.
Just to make the list a little more complete: ActiveJS
I upvoted the AngularJS (full disclosure, I'm involved in a limited way with the angular dev effort) and am very excited about it. I did a side-by-side comparison taking one feature for an internal project (sorry don't have signoff to share it) and implementing it in both AngularJS and Backbone. It was a great exercise and in the end, I'm very much leaning towards Angular. The core developers are great about answering questions and they've done a really nice job with builtin databinding, unit/e2e testing and documentation. Its still in beta with 1.0 coming out in near future. The beta is very stable.
There is a bit of a paradigm shift, and they use a fairly different approach than most. Integrating your favorite jquery plugins takes a bit of effort but is doable and has been done (angular-contrib on github).
I will say (and this is a problem for most js-centric frameworks), make sure to investigate how to make your content SEO-friendly (if its important to you). Since joining the angular community in June, I've noticed the interest is growing and a number of people are making posts saying that they've looked at Backbone and others but really like what they are seeing in Angular.
Maverick is a small JavaScript MVC framework — http://maverick.round.ee
I'm going to pipe up here too - AFrameJS works with jQuery, MooTools and Prototype.
Another one: MooTools-MVC
There was a key-value binding JavaScript framework called "Coherent", which was inspired by Apple's Cocoa Bindings. The framework has been bought by Apple, but there is still an old copy at http://github.com/trek/coherentjs/tree/master.
Try this jQuery based javascript MVC framework.
One more, lightweight and tiny: http://jqnano.oleksiy.pro/
Can.js has everything you need and weighs in at just 8 KB. It's taken the best bits from JavaScriptMVC and distilled it into one small, yet kickass framework with observers, widgets, binding, the works. It is compatible with major frameworks (jQuery, Dojo Toolkit, MooTools, etc.). Documentation is excellent and authors are responsive. It is definitely worth a look.
참고URL : https://stackoverflow.com/questions/386885/is-there-a-javascript-mvc-micro-framework
'IT' 카테고리의 다른 글
루아에는 왜“계속”진술이 없습니까? (0) | 2020.06.28 |
---|---|
람다에서 캡처 이동 (0) | 2020.06.28 |
ssh를 극복하는 적절한 방법 (0) | 2020.06.28 |
Spring Data-JPA와 JPA : 차이점은 무엇입니까? (0) | 2020.06.27 |
본문 또는 HTML 헤드에 스크립트를 작성해야합니까? (0) | 2020.06.27 |