What architecture should I learn to create good JavaScript based software?

I know Model-View-Controller well, I have known about this for years and used it in terms of server-side development with languages ​​such as PHP.

However, now I work with JavaScript and build a large application with it, using SVG, Canvas among other great features that support modern browsers. The project is large, so the architecture behind it should not be fragile.

JavaScript and MVC do not work at home because JavaScript is event driven in nature. So, are there any architectures or anything else that I should definitely learn, understand and implement?

The software will deal with data. It already uses local memory and a web SQL database. I need models, right? There is a user interface, so do I have Views? However, do I have controllers? What about the events? How do I structure everything?

Architecture, architecture, architecture - this is what interests me. I'm fine with the language of my choice.

+3
source share
7 answers

Firstly, I am the author of JavaScriptMVC, so I am extremely biased in a variety of ways. First, there are six things in a JS application:

  • Download scripts
  • Response to user events
  • Update DOM
  • Request data from the server
  • Convert this data to something useful for JavaScript
  • - .

, /.

.

. .

JavaScriptMVC MVC, OpenAjax.

$. , jQuery. , -ui-, . , "tab.activate", :

$('.tab').trigger('tab.activated')

tab.activated , :

".flickr tab.activated" : function(tabEl, ev){
  Flickr.findAll({type : "rainbows"}, function(images){
    tabEl.html("//path/to/view", images );
  }
}

Flickr.findAll flickr, . service/ajax .

, html . , , , . , , . , - , , - .

- , . , ( ) , .

+2

Ext JS. , javascript.

. ( ) ( ), . CSS ( , , , ,...).

MVC . , HTML CSS, ( ) JavaScript. , dom . , , .

+1

MVC - , . , , JavaScript MVC, , , , , jQuery ..

0

JavaScript MVC.

, , Javascript.

JavaScript, .

0

, javascript, UnObtrusive Javascripting, (HTML) (CSS) Behavior (JAVASCRIPT).

0

Althogh javascript-, CoreMVC, jQuery MVC.

CorMVC - jQuery-powered Model-View-Controller (MVC) , -. CorMVC -view-controller . - , -, .

0

, JS- JS , :

http://boilerplatejs.org/

I am the main author of this material and thought about sharing the knowledge that we gained after developing several large javascript products. It addresses the following major issues:

  • Structuring Solutions
  • Creating a complex hierarchy of modules
  • Separate user interface components
  • Communication between event-based modules
  • Routing, History, Bookmarks
  • Device testing
  • Localization
  • Document creation
0
source

Source: https://habr.com/ru/post/1766559/


All Articles