mardi 27 janvier 2015

full emberjs database driven website

Hi I have warm up myself with ember.js and I am a ASP.NET Web developer. by reading more and more about ember.js I found that I can build a page with MVC pattern in javascript.


Seems foolish question but anyway is it logical to this :


1)Create a aspx page which contains some methods like this :



//Shop.aspx
[WebMethod]
public static object GetCustomers(){
var db = new entities();
return from c in db.Custmers select c;
}
[WebMethod]
public static object AddCustomer(string fullname,string phone){
var db = new entities();
Customer c = new Customer(fullname,phone);
db.Customers.Add(c);
db.SubmitChanges();
}


2) Now I will create a app.js and by ember.js I will do something like this:



//for example :
//define new controller to get Customers from server aspx page;
//define new controller to save a customer to server;


3) post my html page with ember libs near the aspx page on server


4) share my website.


So with ember js I had show my total database tables in Ember.Model , so anyone can understand my database scheme. and Hackers can see my web methods. can they call my web methods ? if the can they had hacked me.


At last but not least , does this way of programming safe ?


thanks in advance.





Aucun commentaire:

Enregistrer un commentaire