Entity framework 4.1 is my own ORM killer

by Vahid 29. June 2011 02:27
[No text]


Why I believe software development should be like amazon kindle development

by Vahid 4. May 2011 09:10

Few weeks ago I got myself an Amazon Kindle to facilitate book reading and hopefully get back my reading habits. I am so amazed by the device that today I twitted “it’s my best gadget”. now there are very genuine reasons behind the twit.

it’s meant to be used to read books and it does it perfectly.

  • it has a great screen which is optimized for the reading.
  • does not hurt your eyes.
  • you can read books even in the direct sunlight.
  • it’s handy and light so very easy to carry with you
  • it’s got a long lasting battery life
  • bot built in dictionary which is extremely easy to use
  • has got a great search functionality
  • has got wireless connection so that Amazon can push the books immediately to the device
  • it’s very very easy to use

I have just mentioned couple of it’s great features. don’t get me wrong, I don’t work for Amazon and I am not doing any promotion for the Kindle. the moral of what I have mentioned above it that IT DOES WHAT IT IS SUPPOSED TO DO AT IT’S BEST.

I mean when I need a device to read books on it, I don’t need to have a million color screen with back light which would hurt my eyes and make them tired after couple of pages. yap I agree it would be good to be able to play 3d games on it BUT it requires changing the display type or maybe putting two different displays in the device –crazy but possible-. I would call either of them over engineering which will work against the device objectives. the same scenario is true with almost all characteristics of the Kindle.

now the reason I believe that software development and management should be done in the same way that Kindle development is done is:

  • before starting a new software project, the team should be clear about what they are going to do. i.e. they should know they going to create a book reading device or a gaming device
  • they need to focus on what they are supposed to deliver and how they can deliver it with the best quality. i.e. they need to focus on delivering a device on which reading the book is easy and it’s not important if you can play games on it.
  • they should keep the life as simple as possible not try to inject extra functionalities to the deliverables until and unless it’s absolutely required. i.e. I don’t need to have joy stick on the Kindle I’d rather have to buttons to navigate through the pages.
  • stop over engineering the project. gold plating and over engineering the deliverables most of the time will distract you from focusing on the core values of the project and very often will be your own headache cause you don’t know the impact it. i.e. Kindle does not come as a dual screen device on which you can watch movies and read books because this is not Kindle’s objective.
  • keep your solutions easy to use
  • and finally never give up improving the quality of the functionalities you provide

so these were some of my ideas on delivering software systems the same way Kindle was delivered. I strongly believe most of the software systems development fail either because of the ambiguity of the deliverables specifications or because of over engineering the solution.


General | Technical

Update Single Column In Entity Framework

by Vahid 29. April 2011 18:00

I was working with Entity Framework and I needed to update a single column of a row in the database. basically I was logging the users visit to a web site (ASP.NET). so first time user lands in the website I create a record in database and keep the id in the session. when user’s session times out I needed to update the row and set the exit time of the user. it sounded a bit difficult to do this with Entity Framework I did it this way and worked pretty well:

        public void UpdateVisit(long id, string userId)
            //id (row id) comes from the user so we create an object and assign the id
            VisitInformation visitInformation = new VisitInformation() { ID = id };
                using (var context = new TravIranLogEntities())
                    //Here we attach the object to the context and set the state to unchanged
                    context.Entry(visitInformation).State = EntityState.Unchanged;
                    //update the column(s) that you need to modify
                    visitInformation.UserId = userId;
                    //Send the informatin back to the Database

            catch (Exception ex)
                LogManager.Log("Error in UpdateVisit for user id", ex, LogMode.LogAndEmai);


Tags: ,


Perfect reference to get started with EntityFramework 4.1

by Vahid 27. April 2011 16:27

Just found these set of post in the MSDN site for getting started with EntityFramework 4.1. if you are new to entityframework this is a good point to start




Could not create the driver from NHibernate.Driver.OracleDataClientDriver error in NHibernate

by Vahid 5. April 2011 03:59

I have been playing with Nhibernate to connect to an oracle database using ODP.NET. first POC project which was a console application worked properly but as soon as I moved the codes to a Web Application for POC I started getting “Could not create the driver from NHibernate.Driver.OracleDataClientDriver” error. scratching my head and think about the failure where the same exact code was running in the Console application, tried so many ways but no result. everything was in place, Oracle reference, Nhibernate reference and configuration etc…

finally I just thought of giving a shot to marking the Oracle.DataAccess database to be copied locally in the property window and surprisingly it started working. now don’t ask me why but if you face the same scenario just mark your set Copy Locally property of Oracle.DataAccess to true.


SQL | Technical

Feels good to have smart colleagues

by Vahid 28. March 2011 11:52

in this year’s Microsoft Tech-Ed Middle East our company had five speakers out of which 2 are in top 10 speakers of the event.

Working with smart colleagues not only will help you new things everyday but also will motivate and encourage you to progress even more. well I am lucky to work in a company full of talents.




Teched Middle East 2011

by Vahid 11. March 2011 03:45

Microsoft Tech-ed middle east which was held in Dubai is now over. it was a great experience to be and speak at the Tech-ed. it was also very nice to meet and chat with the other industry professionals. my session went very well and I have also got constructive feedbacks from the audience. Hope so see the guys there next year.

here is some shots by Anton Delsink




Funny definition of jobs

by Vahid 4. March 2011 04:50

Accountant: a person who knows the cost of everything and the value of nothing

Consultant: is someone who borrows your watch to tell you the time, and then keeps the watch

Politician: is someone who can convince you to go to hell but in a way that you would counting the seconds for it to happen

Economist: is someone who tomorrow will come to know that why what he had predicted yesterday did not happen today

Journalist: is someone who spends 50% of his time for NOT talking about what he know and the other 50% for talking about what he does not know

Philosopher: is someone who speaks for the people who are asleep

Psychologist: is someone who charges you for asking you the questions which your wife ask them for free

Sociologist: is someone who gazes at people when people are gazing at the sexy car passing by


Software Developer: is someone who solves a problem which you are not aware of through a way which you don’t understand



تعرف طنز از مشاغل

by Vahid 4. March 2011 04:20

حسابدار : کسی است که قیمت هر چیز را میداند ولی ارزش هیچ چیز را نمی داند.

بانکدار : کسی است هنگامی که هوا آفتابی است چترش را به شما قرض می دهد و درست تا باران شروع می شود آن را می خواهد.

مشاور : کسی است که ساعت شما را از دستتان باز می کند و بعد به شما می گوید ساعت چند است.

حسابدار : کسی است که قیمت هر چیز را میداند ولی ارزش هیچ چیز را نمی داند.

بانکدار : کسی است هنگامی که هوا آفتابی است چترش را به شما قرض می دهد و درست تا باران شروع می شود آن را می خواهد.

مشاور : کسی است که ساعت شما را از دستتان باز می کند و بعد به شما می گوید ساعت چند است.

سیاستمدار : کسی است که می تواند به شما بگوید به جهنم بروید منتها به نحوی که شما برای این سفر لحظه شماری کنید.

اقتصاددان : کسی است که فردا خواهد فهمید چرا چیزهایی که دیروز پیش بینی کرده بود امروز اتفاق نیفتاد.

روزنامه نگار : کسی است که ۵۰% از وقتش به نگفتن چیزهایی که می داند می گذرد و ۵۰% بقیه وقتش به صحبت کردن در مورد چیزهایی که نمی داند.

ریاضیدان : مرد کوری است که در یک اتاق تاریک بدنبال گربه سیاهی می گردد که آنجا نیست.

هنرمند مدرن : کسی است که رنگ را بر روی بوم می پاشد و با پارچه ای آن را بهم می زند و سپس پارچه را می فروشد.

فیلسوف : کسی است که برای عده ای که خوابند حرف می زند.

استاد : کسی است که کاری ندارد ولی حداقل می داند چرا.

روانشناس : کسی است که از شما پول می گیرد تا سوالاتی را بپرسد که همسرتان مجانی از شما می پرسد.

معلم مدرسه : کسی است که عادت کرده فکر کند که بچه ها را دوست دارد.

جامعه شناس : کسی است که وقتی ماشین خوشگلی از خیابان رد می شود و همه مردم به آن نگاه می کنند ، او به مردم نگاه می کند.

برنامه نویس: کسی است که مشکلی که از وجودش بی خبر بودید را به روشی که نمی فهمید حل می کند.



WP7 (Windows Phone 7) WrapPanel

by Vahid 23. February 2011 16:16

I cannot believe that I spent half day figuring out how to wrap controls in a stackpanle control in WP7 Sad smile 

but anyway I finally came to know that I should use WrapPanel instead of StackPanel. so please don’t make my mistake and download the Silverlight toolkit for WP7 from here and then make a reference to “Microsoft.Phone.Controls.Toolkit.dll” assembly from this address:

C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Toolkit\Nov10\Bin\Microsoft.Phone.Controls.Toolkit.dll

and them import the controls to your page using this command:


the toolkit has got the following controls which are really savers Winking smile

  • AutoCompleteBox
  • ListPicker
  • LongListSelector
  • Page Transitions
  • GestureService/GestureListener
  • ContextMenu
  • DatePicker
  • TimePicker
  • ToggleSwitch
  • WrapPanel