| |
Archive for the ‘General’ Category
Friday, June 5th, 2009
Our design team has been spending some time the last few weeks at taking another look at our architectural practices and also at standardizing on a core Web application architecture that we can then drop into the heart of any web application and then extend/wrap it based on the needs of the particular web application we may be working on.
Performance is one of the key factors in determining best practices and for data intensive applications, the database and data access layer performance in particular can make or break an application’s responsiveness more than any other layer in the application.
As we do a lot of ASP.Net/ .Net development, one of our designers Sanguanchai who is based in our Bangkok office has been trying to break down the use of LINQ to SQL versus using the Entity Framework 4 (currently in beta 1) across key considerations – not just performance - for use in our core architecture.
You can take a look at his findings in the post he published yesterday - LINQ to SQL vs Entity Framework. No doubt there are other architects and developers out there trying to get a handle on the same question and we hope you find this useful.
On a slightly related note, if you are the podcast listening type, .Net Rocks had Dan Simmons, Dev Manager on the EF4 and LINQ to SQL Team as a guest on the latest show. It’s good listen and you get some background on Microsoft’s decisions – including why EF is at version 4 though it is actually the 2nd release. You also get a view into the decisions behind certain features in EF4 and I personally got a better understanding of how best to leverage certain features of EF4 that were opaque to me thus far.
Again, the direct link to Sanguanchai’s post:
http://www.osellus.com/blogs/2009/06/04/linq-to-sql-vs-entity-framework/
Enjoy!
Posted in General, Microsoft, The state of the art | 2 Comments »
Thursday, June 4th, 2009
Compare features for LINQ to SQL vs Entity Framework
| Feature |
LINQ to SQL |
Entity Framework |
| Model |
domain model |
conceptual data model |
| Databases Supported |
SQL server only |
variety of databases |
| Data Sources |
tables only |
tables, replication, reporting Services, BI and etc |
| Complexity |
simple to use |
complex to use |
| Development Time |
rapid development |
slower development but more capabilities |
| Mapping |
class to single table |
class to multiple tables |
| Inheritance |
hard to apply |
simple to apply |
| File Types |
dbml file only |
after compilation generate edmx file with 3 sections to represent the schema: csdl, msl and ssdl |
| Create complex properties (e.g. Customer type may have Address property that is an Address type with Street, City, Region, Country and Postal code properties) |
Not Support |
Support in VS2010 Beta 1 but we can manually modify in .edmx file. |
| Query |
1. LINQ to SQL (for select)
2. Data Context (for update, create, delete, store procedure, view) |
1. LINQ to Entities (for select)2. Entity SQL (is a derivative of Transact-SQL, it supports inheritance and associations)
3. Object Services (for update, create, delete, store procedure, view)
4. Entity Client (is an ADO.NET managed provider, it is similar to SQLClient, OracleClient, etc. It provides several components like EntityCommand, EntityTransaction)
|
| Can synchronize with Database if Database Schema is changed |
Not Support |
Support |
| Performance |
Very slow for the first query |
Very slow for the first query. But overall performance is better than LINQ to SQL (Please see the result in the attach file) |
| Continue to improve features in the future |
No |
Yes |
| Generate database from entity model |
Not Support |
It will support in VS2010 Beta1. |
Limitation for Entity Framework in VS2008 SP1
1. It will throw error in runtime if we use Contains statement. For example,
from p in context.Yard_Projects
where p_projectIDs.Contains(p.ProjectID)
select p
2. It will not generate method that map to store procedure that are not return as entity type. (We need to Entity Client to execute store procedure.) For example,
Void DeleteProjects(@CSVProjectIDs)
3. We need to map every column of a table in the storage schema. If some columns are not mapped, it will compile error.
4. If we delete a type from diagram, it’s difficult to put it back. We may manually update in .edmx file or delete old one and generate new model.
5. You don’t get a lot of control over the storage schema at all. What you mostly see is the client schema and the mapping to the storage schema.
6. If you want create methods that are map to store procedure that has the result from multiple tables, we need to manually modify section “SSDL” in the .edmx file.
Performance Test
I tried to test on LINQ to SQL and Entity Framework, I found the overall performance Entity Framework is better than LINQ to SQL. I separated test cases into 2 test groups.
1. Test select/create/update/delete for single table. You can see my test result in the “TestForSingleTable” sheet.
2. Test select/create/update/delete for single table with many associations. You can see my test result in te “TestForManyAssociation” sheet.
You can see the performance report in the link, PerformanceReport
Recommendation
I think we should use Entity Framework than LINQ to SQL because many reasons as follows.
1. It is more flexible to mapping entity model to database. You can map one class to multiple tables, using inheritance.
2. It supports many queries, you can use LINQ to Entities, Entity SQL, Object Services and Entity Client.
3. When the database schema is changed, you can synchronize entity model from latest database.
4. It has better overall performance when compare with LINQ to SQL.
5. It will be improved many features in the VS2010. You will create complex data type, generate database from entity model.
6. It supports many database vender other than SQL Server.
But disadvantage of using Entity Framework may be complexity and development time.
Refer to my performance report, if we use Entity Framework to implement in the data layer, we should use the following patterns.testperformancelinqtosql_entityframework
1. Use LINQ to Entity for simple queries.
2. Use Entity Client or Object to execute Store Procedure for complex queries (many joins, groups) or queries that perform delete many entities with contains many associations.
3. Use Object Service to insert, update, delete single/multiple entities.
Posted in Architecture, General, Microsoft | 4 Comments »
Saturday, May 16th, 2009
Ideally the execution of business processes should have a machine-like predictability and repeatability. In contrast, Software development processes–and to a certain extend IT processes–are inherently knowledge based (performed by knowledge workers with specialized expertise), and although a certain level of repeatability is desired, are not mechanically repeatable.
Posted in General | No Comments »
Tuesday, May 12th, 2009
I was reading a very interesting Reuters article about Honda’s new entry into the hybrid car market. It talks about how Honda has differentiated itself from Toyota (the previous market leader in this area) by incorporating an innovative software in its new hybrid model: Insight.
But pressure to innovate in the hybrid market won’t necessarily be all about the hardware. If hybrids and other cars embedded with electronic controls and more advanced computing power make their way into the mass market, opportunities could also arise for software. The Insight, for example, includes an “Eco-Assist” display on the dashboard that takes a cue from video games to help educate and encourage drivers to accelerate and decelerate for maximum fuel efficiency. As Wagner James Au explained in an Earth2Tech post about the feature earlier this year, “Like a role-playing game, the driver’s behavior is also tallied over time, and displayed symbolically — here, in the form of an ivy-ringed trophy achievement that a driver can gradually unlock with green-friendly driving. It’s sort of like Wii Fit, but for cars.” Depending on how much Honda decides to open that data, it could provide fodder for game developers, application platform providers and other industrious web entrepreneurs.
Software as a critical competitive advantage has already been a proven fact in the cell phone industry. Now it’s the auto industry’s turn. As software developers, we live in exciting times.
Posted in General, The state of the art | 2 Comments »
Friday, May 1st, 2009
I have just completed the first draft of a white paper on Process Asset Repository System. I greatly appreciate all comments, corrections and feedbacks. You can reach me at phodaie@osellus.com.
collaborative-process-asset-repository-system.pdf
Posted in CMMI, General, Process Asset Repository | No Comments »
Friday, April 24th, 2009
This is the first in a series mini-posts on technical and architectural aspects of process asset repository systems. In this post I will introduce the process object engine sub-system.
Deployment of a process asset repository system is critical for any organization striving to advance from project-level process management—CMMI Level 2 maturity–to organizational wide process management that facilitates application of the organization’s best practices and lesson learned across all of its projects—CMMI Level 3 maturity. Process asset repository system is an enterprise class application that manages all aspects—creation, storage, collaboration, consumption, appraisal–of the organizational process improvement needs.
Abstracted from the users, process object engine forms the core of process asset repository system. Other parts of the system, as well as, external applications interact with the process object engine through a set of web-services APIs. Process object engine provides the necessary infrastructure services including persistence, transaction support and change control.
Moreover, the organization’s process assets are granularly captured using an object model. Process object model is an interesting topic and I will talk more about in future posts.
Posted in General, Process Asset Repository | 3 Comments »
Saturday, April 11th, 2009
Application Lifecycle Management (ALM) is often wrongly thought to only cover only the Software Development Life cycle (SDLC). David Chappell’s excellent and concise whitepaper focuses on this misconception and explains how ALM is more than just the development of the application though that is certainly an important part of it.
ALM is broken down into the Governance, Development and Operations aspects. More importantly Chappell continues the point I had made briefly in my previous post - that there are ALM tools out there which are largely concentrated on the development aspect but their true value can be achieved by integrating them with tools that cover other aspects of ALM - eg: CRM.
To quote the whitepaper:
The three aspects of ALM—governance, development, and operations—are tightly connected to one another. Doing all three well is a requirement for any organization that aspires to maximize the business value of custom software. But this isn’t an easy goal to achieve. Each of the three is challenging to get
right on its own, and so getting the combination right is even more challenging. The right tools can make this easier. A number of vendors today provide tools that are horizontally integrated, i.e., tools that work together well on one of the three lines. For example, Microsoft’s Visual Studio Team System brings together a range of tools supporting several aspects of the development process. Yet tools should be integrated not just horizontally but vertically as well, helping organizations make connections across the three lines. For instance, project management tools should be connected to development tools, which in turn should have connections to the tools used for operations.
These connections are beginning to appear. Visual Studio Team System, for example, can connect with Microsoft’s Project Server to help project managers get up-to-date information on what developers are doing. There’s still plenty of room for improvement, however, and no vendor today offers a set of ALM tools with full vertical integration across all three lines. Tools should be integrated not just horizontally but vertically too.
Read the complete white paper here.
Posted in General | No Comments »
Saturday, April 4th, 2009
IBM Rational team launched EPF more than five years ago with a premise of creating an open source like community for software development processes and methodologies. Unfortunately, from the beginning, the Rational team was not willing to give up control and EPF has been only open in name than in reality. I would say, 99% of the contribution so far has been from IBM. Initially EPF was supposed to be a kernel based methodology. Plug-ins were to be added to the kernel as to satisfy the requirements of development project environments. This takes an additive adoption of methodology rather than RUP’s trimming approach. After few years of taking this approach, suddenly EPF changed direction and took a practice based approach. Now it seems that the IBM Rational team has abandoned EPF and has moved to their latest story: Measured Capability Improvement Framework (MCIF). I don’t know much about MCIF right now, but intent to research it.
My point is that this is an irresponsible behavior by respected methodologies, it confuses the potential adaptors and the grater market. I rather have IBM methodologies (content team) keep a low profile and let the badly need Jazz (very impressive IBM tool to rival VSTS) based tools flourish.
Posted in General, Processes & Methodologies | No Comments »
Monday, March 30th, 2009
These days we have a methodology overload. It’s not that I don’t recognize the importance of SDLC methodologies, rather I feel we already have more than enough methodologies to satisfy the needs of any organization. My proposal: lets put methodology development on pause for two years. During this grace period everyone should focus on development and deployment of tools that support existing methodologies and processes. These tools should codify any existing methodology and simplify its application in real-world projects. In short, lets give what organizations have planted a chance to grow so it bear fruits.
Just consider the wide variety of methodologies available today: SCRUM, Extreme Programming and other agile methodologies, MSF, Eclipse Way, RUP, EssentialUP, OpenUP, double-Chocalte-PestasioUP (and other flavor of the day UPs).
This methodology overload has resulted in confusion and paralysis of many organizations trying to adopt and deploy processes in their software development projects.
As a final note, I would be grateful if methodology theories put their book authorship careers on hold for two years for the the betterment of the end users.
Posted in General, Processes & Methodologies | No Comments »
Tuesday, May 27th, 2008
Posted in General, Microsoft, Processes & Methodologies | Comments Off
|
|
|