0

I have a lot of database experience, but virtually no application programming experience. At work, we have an EDMX? model generated from entities in the database, and we transform T4 templates to create what I assume are classes. I think this is the Entity Framework? From there, the application (in C#) takes the data and (uses an MVC structure?) to bind the data to XAML (it is a Silverlight application). I assume the XAML is embedded into the webpage using Javascript, which is contained in HTML.

I struggle to find a generic top-down roadmap online that can explain how data gets passed around in such a structure, but I was wondering if anyone had a good solid explanation of how this generally works? If I can get a clearer picture of how data is passed, I can figure out what areas I need to improve on, knowledge-wise.

srbrills
  • 103
  • 3
  • How much experience do you have in object-orientation? – Robert Harvey Apr 29 '15 at 21:29
  • possible duplicate of [Best Practices: Database app programming patterns](http://programmers.stackexchange.com/questions/24466/best-practices-database-app-programming-patterns) – gnat Apr 29 '15 at 21:41
  • see also: [OOP and relational databases](http://programmers.stackexchange.com/questions/229897/oop-and-relational-databases) – gnat Apr 29 '15 at 21:42

1 Answers1

0

Entity Framework is an Object-Relational Mapper; it translates the results of SQL queries into objects and collections. For example, this query:

SELECT name, address, city, state, zip FROM customers;

might produce a collection

IEnumerable<customer> result

of objects that looks like this:

public class Customer
{
    public string Name { get; set; }
    public string Address { get; set; }
    public string City { get; set; }
    public string State { get; set; }
    public string Zip { get; set; }
}

What happens from there depends on your application's structure. The ASP.NET server may expose a series of REST services that produce JSON or XML that is consumed by the Silverlight app (the usual arrangement):

 {
     "firstName": "John",
     "lastName": "Smith",
     "age": 25,
     "address":
     {
         "streetAddress": "21 2nd Street",
         "city": "New York",
         "state": "NY",
         "postalCode": "10021"
     },
     "phoneNumber":
     [
         {
           "type": "home",
           "number": "212 555-1234"
         },
         {
           "type": "fax",
           "number": "646 555-4567"
         }
     ]
 }
Robert Harvey
  • 198,589
  • 55
  • 464
  • 673