While we are waiting for the next upcoming version of javascript, that is ECMAScript 6 codename Harmony, we are enforced to use object-based/functional-based javascript. Currently there are no class construct, interface, inheritance, means for information hiding, and so on. But I won't argue about its usefulness, I just wondering about the usage of UML constructs in complete Single Page Application framework such as AngularJS.
Is UML only appropriate for ECMAScript 6 Harmony?
It is said that when we use mongoDB we are no longer need ORM anymore because the output is already object, then now Oracle has provided HTTP Plugin that enable MySQL to provide RESTful CRUD API and has JSON as its output. The question is, when I creates Class Diagram, I can convert it to JPA entity class, than is it still useful when I use Restangular-->MySQL or just nice to have?
In Doug Rosenberg & Matt Stephens' book Use Case Driven Object Modeling with UML, they use one boundary lifeline for each page and entity lifeline for each domain model that are involved within his sequence diagram, so when I use Angular-UI's UI-Router, then what is it count to be boundary lifeline? is it each state? then I guess the control lifeline is my angular's registered controller, and entity lifeline for my javascript object that I pass to each Restangular's post/put/delete method, aren't they?
I think Restangular is a kind of Data Access Object, isn't it?
Is this kind of Model Driven Development not appropriate for AngularJS at all, if so then what it is that appropriate?
code example for accesing mysql directly from restangular:
Restangular.setDefaultHeaders({'Authorization':'Basic '+btoa("basic_auth_user:basic_auth_passwd")});
RestangularProvider.setBaseUrl('http://localhost:8080/crud/mydatabase/');
myModule.controller('salesmanController',
function($scope, Restangular){
var salesmanDAO = Restangular.all('salesmanTable');
$scope.allSalesman = salesmanDAO.getList().$object;
$scope.insertSalesman = function(){
var newSalesman = {firstName: $scope.newSalesman.firstName, lastName: $scope.newSalesman.lastName, city: $scope.newnewSalesman.city};
salesmanDAO.post(newSalesman)
.then(
function(newObject){
$scope.allSalesman = salesmanDAO.getList().$object;
},
function error(reason){
console.log("the reason: ", reason)
}
);
$scope.newSalesman.firstName = '';
$scope.newSalesman.lastName = '';
$scope.newSalesman.city = '';
}