Split model methods into two different parts to clean up functions
Issue #109
new
The Model
class have two types of methods:
- action methods, such as
save
,update
,find
etc, that sends a request and gets information from the server - support methods, such as
makeRequest
,mountUrl
and etc, that are used by all action methods
Some action methods are restricted to instances of objects, such as save
; others should be used only by the clean "class", such as find
and saveData
. However, both of them use the support methods.
Thus, the support methods should be inside a object, such as ModelSupport, and the other methods inside an object called ModelActions. This way we can make the actual model objects inherit the support methods and filter what's inherited by the prototype and instance versions of the model.
This would make the final models cleaner.