EAV and the .NET Framework
Recently I've been working on a web application's database model in which I had different types of products and services that my client is going to offer in his eShop. The problem was different nature of attributes each type had and I should have defined a relationship between them and my online order pipleline. Using the common relational database approach I finished up with an OrderDetail table which had multiple foreign keys related to tables which was representing different kinds of products. Anyway, I'm not going to explain my project details here. That was a preface to explain a concept that Farid Arzpeyma introduced to me: Entity-Attribute-Value (EAV) Model, an approach that is widely used in enterprise eCommerce platforms like Magento.
There are many documents and articles out there describing EAV, its concept, principals and usages and I'm not going to talk about it here but quoting this which describes it shortly:
Entity-Attribute-Value model (EAV), also known as object-attribute-value model and open schema is a data model that is used in circumstances where the number of attributes (properties, parameters) that can be used to describe a thing (an "entity" or "object") is potentially vast, but the number that will actually apply to a given entity is relatively modest. In mathematics, this model is known as a sparse matrix.
What I came up with in my mind was possible existing frameworks for .NET developers to implement this model in their applications. Because EAV breaks the rule in which we're urged to use a vertical data representation (using columns) - by introducing another method of collecting data records and their types in table rows - it's necessary to adopt our OOP code to smoothly interact with this new structure. By the time Microsoft hadn't released SQL Server 2005, storing hierarchical data structures was a painful handy job for database developers but at the time Microsoft introduced XML datatype with SQL Server 2005 it became easier for them to natively store such structures right inside a column in a database. EAV is a similar concept and its main goal is to enable developers store attribute/value information in a table in a hierarchical manner.
Unfortunately it seems that there have been very few interests in the .NET community to work on open source frameworks in order to work with EAV database models. My searches shows a disappointing number of articles, blog posts and tools for this purpose.
The first article I found was Entity-Attribute-Value (EAV) model with SQL Server 2005 xml datatype that is talking about how to implement an EAV-like model using the new XML datatype in SQL Server 2005 and later. Mladen Prajdić has also referenced to another article explaining EAV in SQL Server more generally.
The second was a newer talking about a solution with Entity Framwork: Generic Entity Attribute Value Model – A POCO Implementation. This is closer to what I had in my mind because it's talking about EAV in general and how to implement our data layer, built on EAV pattern, using EF.
And finally the third was an open source project on CodePlex but unfortunately it seems that it's no longer active and there isn't even a public release out.
My conclusion is, the .NET community hasn't done much efforts on EAV concept and in my opinion it is because Microsoft policy - since creation of .NET Framework - has been just to spread this technology and best practices have rarely gone further on advanced and enterprise topics.
Microsoft Released Anti-XSS 3.0 Beta and CAT.NET CTP
Recently Microsoft released a beta edition of Anti-XSS library V3.0. Here’s a list of some new features which were added in this release:
- An expanded white list that supports more languages
- Performance improvements
- Performance data sheets (in the online help)
- Support for Shift_JIS encoding for mobile browsers
- A sample application
- Security Runtime Engine (SRE) HTTP module
Also as you can read on Microsoft Connected Information Security Group blog they have also released a CTP version of CAT.NET (Microsoft Code Analysis Tool .NET) which is a managed code static analysis tool for finding security vulnerabilities such as Cross Site Scripting - SQL Injection - Process Command Injection - File Canonicalization - Exception Information, etc.
Downloads:
iDevCenter is back!
A few years ago, when I had begun learning ASP.NET and Web Development, I found a nice and lovely guy who was very professional at that age. We were both university students (in different universities) then and was studying Mathematics; me, Pure Mathematics and he, Applied Mathematics. Almost every night, we were chatting using poor dialup connections and he was opening new doors of knowledge to me. He was a professional and pioneer developer and coder at age of 20-21.
I’m talking about my dear friend, Soheil Rashidi. But you may ask why I’m talking about this nostalgia?! Soheil had a website dedicated to Persian language developers to provide articles and useful resources for them. We call it iDevCenter (or iDC). About 2-3 years ago Soheil suddenly stopped iDC because of what he calls an ‘Unresponsive Model’. Now I can officially and proudly announce re-launch of one of my most favorite Persian websites in field of coding and development. Yeah iDevCenter.com is back!
New iDevCenter is completely different from what is was 2 years ago. iDevCenter v3.0 is a powerful Link Directory + a nice Wiki. All old iDevCenter members can login to their accounts using the same username and password (except one poor person that only I and Soheil know :-D). All information are categorized using tags and you can easily find relevant information.
If you’re Iranian or know Persian language I invite you to take a deep look at how Soheil rocks on iDevCenter.com!
And special message for my dear Soheil: A world of congratulations and sweet dreams for you :-*
Source Control for .NET Developers, The open source approach
Independent developers who don’t work in a team may think that source control is not necessary for them because nobody else works on their projects but this is a big mistake!
Before I lost some source codes which was on my previous dead laptop I didn’t feel I need source control for my projects but after that incident I started to research about possible source control approaches for .NET developers and Visual Studio and in this post I want to share results with you.
There are two main source control systems: Concurrent Versions System (CVS) and Subversion (SVN). I was looking for a system that covers the following specifications:
- Free technology.
- Free Ad-on for Visual Studio.
- Free server to host source codes.
My choice was SVN which is initiated by CollabNet Inc. because it’s free and open source and also has an official ad-on for Visual Studio which is offered by CollabNet. AnkhSVN is a very good free tool to implement all source control activities right inside Visual Studio. You can download it for Visual Studio 2008 here.
By now, you have the technology and tools to control your source and take care of them but there is one another requirement. You need a server that supports SVN to host your source codes and absolutely you look for a free one ;-) Assembla is a good choice because it offers a free package as well as paid commercial packages. One you register, you can define various workspaces with unlimited team size in your free 250 MB storage space.
You’ve almost done, now you can start Visual Studio, open a solution or project, right click on it and add it to SVN. It’s so simple and easy.
In Assembla you can receive source control comparison (Diff), source history and many more features.
In brief, you have to take these 2 steps:
ASP.NET MVC Tutorial in PDF format
We are getting closer to official release of Microsoft ASP.NET MVC. There are couple of tutorials and videos to get started with this new approach to enterprise web applications development. I found an eight part series of tutorial (in both C# and VB) on ASP.NET Website; good news is that all of these tutorial parts are available in PDF format too. I downloaded all of them and compress them in a single .rar file.
You can download it at http://www.sharplife.net/Files/ASPNETMVCTutorialPDFVersion.rar (approx. 1.7 MB).
Enjoy ;-)
