Creating a Scaleable Application
In the first blog in this series, we provided a comprehensive introduction to Microsoft's Entity Framework. Going forward, we addressed the creation of custom web applications. The third outlined creating a data access layer and the fourth was really helpful in identifying a couple of the more common EF issues and how to troubleshoot them.
So, now that you have some understanding of how Entity Framework actually works, you are ready for the next step in understanding why this is such a positive solution for your business. So how does Entity Framework allow developers to create a more robust and scalable application? Without getting too technical, an example is probably the best way to show you just how useful this can be.
Generally, when you are using a database there is a great deal of tedium involved in constantly adding new information, making sure it falls into the right categories and writing the particular language to keep things up to date. As we’ve discussed, Entity Framework is an open source framework provided by Microsoft that does a great deal of the busy work for you.
Let us take a moment to look at an example that may be used by a school. The school is the domain in which everything is stored within the database. As students rarely make a career out of going to high school, the database is constantly changing and each student has their own particular attributes that need to be tracked. These attributes can vary from GPA to days missed to the type of classes they are taking. To keep this information updated traditionally, a great deal of language would need to be updated each time to create an accurate database. With Entity Framework, the attributes are added to each student and the framework does the busy work to make put them in the right areas of the database.
This allows you to create classes with different connection with much more ease and at a faster rate. While the code generator in the framework may not be as robust as what will be written by an engineer, once the groundwork is done, Entity can handle the rest with ease.
In addition Entity offers T4-like template code generation. With predefined templates that can generate code in C# or Visual Basic for the model that can support persistence aware and persistence ignorant entities. It also supports validation framework for entity property values validation MVC Controller and views, Data Annotations metadata classes and a wide variety of other technical aspects that in short, makes life easier for everyone involved in a project.
You will also have the option to update to and from database with wizards that allow you to synchronize with ORM models in any direction automatically. A wide variety of mapping is supported as well, from entity to table, table splitting and complex types just to name a few. Unlike EDM designer Entity does not require manual XML code editing regardless of how complex it may be.
While this is a very high level overview of what is on the table when it comes to incorporating Entity Framework into your business, it is paramount to understand that this was designed to make a developer’s job much easier. It succeeds at that in spades and the fine folks here at Extra Nerds will be happy to discuss how we can help with your next project.
Stop back next week for our sixth and final installation in this series which will tell us how Entity Framework reduces development time.