A
A
Abc Edc2015-05-09 08:34:11
API
Abc Edc, 2015-05-09 08:34:11

How often do you use / need to use API design and build patterns?

More often, the code is simply divided into models and controllers and a router? Or are the patterns mainly used in the client side? Because if it weren’t for Angular, I wouldn’t even take an interest and wouldn’t know about their existence

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-05-09
@gleber1

You must understand why patterns are needed at all. Over time, you can come to some standard solutions without books, etc. That is, you can somehow take the tighter "gang of four" and so ... you look at your code and "oh, so that's what it's called."
For example, almost every javascript developer has written something along the lines of...

var api = (function() {
    // какие-то приватные вещи, к которым не стоит давать доступ из вне
    // что бы все было чистенько
    var privateVars =  {};
 
    // публичный метод
    return function () {
         
    }
}();

But not everyone can say that this is a " module template ". In the case of CommonJS, it happens automatically, but the essence remains the same. I think a good half do not even know that all this is for the sake of encapsulation.
The point is not to use templates (it is important to understand why they appeared at all), since you will use them one way or another, but more in general terminology. This reduces the time required to discuss the implementation.
ps I use it all the time, in the context of Angular I even implement a service layer so that all business logic is outside the controller and the latter is used to separate business logic from presentation logic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question