Framework framework for existing JS code

I have some javascript procedural code that I wrote for an open source application, and I would like to reorganize it in OOP, and since I have very little experience with javascript frameworks, I have problems finding the one that suits my needs, although I haven't tried anything yet, I just read about AngularJS, Backbone.js and knockout.

I want to structure the code, because at the moment there is a mess, global variables and functions scattered around.

I should mention that all business logic is processed at the server level, so client code only processes the user interface using the data it receives or requests from the server.

The code can be found here: https://github.com/paullik/webchat/blob/asp.net/webchat/Static/Js/chat.js

Do you have any suggestions?

+5
source share
1 answer

Object-oriented JavaScript is not necessarily the answer to all your problems.

My advice is to be careful in the choices you make on this topic.

In practice, OO-JS can add extra complexity to your code in order to be more like traditional object-oriented languages. As you probably know, JS is unique.

It is important to know that there are design patterns that structure your code and preserve the brightness and flexibility of the implementation.

, JS OO. Axel Rauchmeyer - " JavaScript, , JS ".

, JS . , , - . , , (C/Java).

JavaScript?

- Addy O 'Somani Essential Design Patterns. JavaScript.

... .

. require.js - JS- .              js , . yepnope . , js. ( ).

. MVC. Model View Controller, .          , . , angular... . , , 1) 2) .

. . , .    , .     , .

. . OO JS. , ... . , , , .

. . . : AnotherObject.member; , . , . . JS PubSub.

F. . - , AJAX, Window 8, Firefox OS Node.js - - - -io. .

. JavaScript.

, .

, .

+5

All Articles