declex icon indicating copy to clipboard operation
declex copied to clipboard

Method "with" for $LoadModel and $PutModel

Open smaugho opened this issue 7 years ago • 0 comments

In previous versions of DecleX, it was implemented @db() and @server() to pass parameters to the Injecting processes for @ServerModel and @LocalDBModel. Playing with this and "db-ignore" and "server-ignore" specials queries, can be managed that the Get or Put operation be executed using only a specific Model..

All this mechanism is not well documented, and in general it is not clear or easy to understand.

A method called "with" that takes as parameters an array of "Annotations" should be created. It would handle the problem of executing the action only with a specific model, as well as the order in which this models should be executed..

Ex.

    //Load the model only from within the server
    $LoadModel(user).with(ServerModel.class);

    //Put only to SQLite DB.
    $PutModel(user).with(LocalDBModel.class);

    //By default this operation is done first from LocalDBModel, then from ServerModel, this would change
    //how the order in which the operation is done. 
    $LoadModel(user).with(ServerModel.class, LocalDBModel.class);

smaugho avatar Mar 04 '17 00:03 smaugho