Memory Leak And The IDisposable Pattern

April 29, 2008

Memory Leak And The IDisposable Pattern Sunday morning.I return to my current project after two weeks that I wasn't there.The "welcome party" is a story about the crisis of the last two weeks.Apparently, we have a memory leak and in the past two weeks nobody solved the problem. The production servers work for five hours and thenthe memory usage is going over 900MB and the servers crush and the applicationcrushes with them. The system administrators make a recycle to the application and the story goes on again.Of course the users are angry because it was a new release of the...

Schema Definitions Of EDM In Entity Framework

April 26, 2008

Schema Definitions Of EDM In Entity Framework On the previous post about the entity framework I wrote about the entity data model (EDM) and explained how to add a one to one mappingmodel to your application.Today I'm going to explain a little about the bits and bites of the newXML schema types which describe the models. The Schema TypesThe EDM is divided into three models (as explained in my previous post) - the conceptual, the mapping and the logical model.Every model has it's own XML schema type: Store Schema Definition Language (.ssdl) schema type - The schema describes the database tables and...
no comments

Singleton Pattern

April 22, 2008

Singleton Pattern The first pattern in the creational pattern series is the singleton pattern.You can read my previous posts about design patterns here: Structural patternsDecorator pattern Proxy patternFacade patternAdapter patternComposite patternBridge patternFlyweight pattern IntroductionThe singleton pattern is a very useful pattern. I encountered it while I was a second year student in an object orientedcourse I took. During that course we had a lecture about design patterns and the singleton pattern was one of the patterns that were discussed. Think about it, one lecture about design patterns in a course about object oriented... What is the Singleton Pattern?The singleton pattern ensures that...
6 comments

Creational Patterns

Creational Patterns In my first post about design patterns I wrote that there are three kinds ofdesign patterns. I covered the first kind ,the structural patterns, in the previous posts.You can read my previous posts on structural patterns here: Decorator pattern Proxy patternFacade patternAdapter patternComposite patternBridge patternFlyweight pattern Today I'm going to start the journey and dive into the creational patterns.What are Creational Patterns?Creational patterns deal with the instantiation process. Their main issue is to separate the application from the way objects are created, composed or represented. There are two common subjects in the creational patterns - They encapsulate the knowledge...
no comments

LINQ To SQL Vs. Entity Framework

April 20, 2008

LINQ To SQL Vs. Entity Framework During the making of a new lecture, I made a comparison between LINQ to SQL and entity framework. Here are the things I wrote in the lecture: Category LINQ to SQL Entity Framework Model domain model conceptual data model Databases Supported as the name indicates: 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 files only edmx filesafter compilation generate 3 xml files to represent the schema:csdl, msl and ssdlThere are more differences between the frameworks...

Flyweight Pattern

Flyweight Pattern In the last post about structural patterns I'm going to explain how and when you should use the flyweight pattern. You can read my previous posts on structural patterns here: Decorator pattern Proxy patternFacade patternAdapter patternComposite patternBridge pattern What is the Flyweight Pattern?The flyweight pattern is used whenever you have large amount of small objects that share common information. The use of the pattern reduces the storage of those objects.The flyweight distinguishes between inner state (sometime called intrinsic state)and outer state (sometime called extrinsic state) of the object.The inner state can be shared by the objects and therefore minimize the...
2 comments

Entity Data Model (EDM) In Entity Framework

April 18, 2008

Entity Data Model (EDM) In Entity Framework In the last post about entity framework I wrote an introduction about the framework.Today I'm going to dive into the heart of the framework - the entity data model (EDM).What is the Entity Data Model (EDM)?The EDM is a specification for defining the data used by applications built on theentity framework.Entity data model (EDM) desgin: EDM LayersThere are three layers in the EDM: Conceptual layer Mapping layer Logical layer The layers help to bridge the gap between the relational database schema and the wanted entities in the application. Every layer is represented in a XML schema.The conceptual...
no comments

Bridge Pattern

April 12, 2008

Bridge Pattern In this post I'm going to explain the use of the bridge pattern. You can read my previous posts on structural patterns here: Decorator pattern Proxy patternFacade patternAdapter patternComposite pattern The Bridge PatternThe bridge pattern decouples an abstraction from it's implementation so the two can vary independently. In other words we make a bridge betweenthe abstraction and it's implementation and therefore we won't have a binding between the two. The pattern helps us whenever we need to select or switch the implementation at runtime.For a UML diagram of the pattern go to dofactory site.Example in C#How does it work? Lets...
one comment

Composite Pattern

April 11, 2008

Composite Pattern Today it's the turn of composite pattern to be revealed. You can read my previous posts on structural patterns here: Decorator pattern Proxy patternFacade patternAdapter pattern What is Composite Pattern?The composite pattern is enabling us to treat single component or a composition (group) of components in the same way. There are typical operations that can be performed on thesecomponents which include operations like add, remove, get item and so on.A simple example is the activity model of windows workflow foundation.Activities are the building blocks of workflow. Every activity is easy to create, either from writing code or by composing it...
no comments

Getting Started With Entity Framework

April 10, 2008

Getting Started With Entity Framework In this post and on the following I'm going to write about the ADO.NET Entity Framework.To those who wait for the design pattern posts, I'm going to continue writing about design patterns as well.IntroductionLets start at the beginning. What is this entity framework that you probably heard about?The entity framework is a framework built on top of ADO.NET.It was made to support development of data-oriented software applications.It is currently in beta 3 and suppose to be released with Service Pack 1 for visual studio 2008. The entity framework tries to addresses the impedance mismatch between...