Mike Borozdin's Blog

A blog about programming, web and IT in general

Search

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© 2009 Mike Borozdin

Getting Intrigued by Entity Framework

If you use LINQ to SQL, you may wonder why Microsoft released yet another ORM (Entity Framework), while they already had one. You may also be confused, because it’s not obvious which one to choose. Anyway, the Entity Framework has its own shiny features that don’t present in LINQ to SQL. Besides, you can still use LINQ to retrieve data with the Entity Framework, in this case, it’s called LINQ to Entities, at the same time you can also use a SQL like language – Entities SQL. In this story I’ll show one particular feature of Entity Framework that certainly must interest many developers.

Basically, Entity Framework provides a higher level of abstraction than LINQ to SQL. In fact, in hides the data level. So, you deal with objects that represent real entities, not database tables, like if you were using LINQ to SQL. I mean when you generate LINQ to SQL classes, it creates classes for each tables, even though those tables are merely junction tables without any reflection in our real life.

Let’s have a look at the example, to make things clear.

In the Northwind database we have tables – Employees and Territories that are linked with each other by using the third one – EmployeesTerritories.

Northwind

Entity Framework modeler generates this schema:

image

There are a lot of interesting things here. First of all, there is no junction table, instead there are navigation properties that allows us to access the corresponding territories or employees.At the same time, since the Employees table also points to itself, there are the navigation properties (Subordinates and Manager that are responsible for that kind of relations. Second, there are no foreign keys, we have navigation properties instead of them as well.

Thus, the Entity Framework allows us to deal with objects that clearly represent real life entities, instead of objects that just reflect tables.

That’s just one of many sexy features of the Entity Framework. I’ll try to cover them in the next articles, moreover I’m going to put a comparison between LINQ to SQL and Entity Framework in terms of programming, because sometimes it’s not so easy to migrate from LINQ to SQL to Entity Framework because of some pitfalls.


Posted by Mike Borozdin on Sunday, September 28, 2008 10:07 PM GMT
Bookmark on MSDN   Add to Technorati Favorites  Kick it!  
Permalink | Comments (3) | Post RSSRSS comment feed

Entity Framework and MySQL

Although MySQL don't seem to be very interested in providing a native support for LINQ to MySQL and you have to use 3-rd party providers to interact with MySQL by using LINQ, they seem to move towards Entity Framework. They are holding a webinar about using Entity Framework with MySQL on September, 30.

I think this can be a one reason of many why it's worth using Entity Framework, the support by database vendors is a great thing. It is not the only reason, of course, there are many other ones. The main thing is that Entity Framework provides a higher level of abstraction than LINQ to SQL, for instance. It can be a topic for a series of articles, so I think, I'll cover Entity Framework in other articles.


Posted by Mike Borozdin on Wednesday, September 10, 2008 7:57 PM GMT
Bookmark on MSDN   Add to Technorati Favorites  Kick it!  
Permalink | Comments (2) | Post RSSRSS comment feed

Develop PHP in Visual Studio

I've been programming with PHP for many years and have used a lot of editors and so-called IDEs, I must admit that PHP IDEs have become much better now and they differ significantly from simple editors with syntax highlighting. Anyway, in the recent time I have been working much with Visual Studio. I must confess that I really love it, some people may argue of course, especially Java developers who are fond of their development tools and tend to look down at other ones. So, I was happy to learn that there is a plug-in that enables you to program with PHP in a familiar development environment of Visual Studio. Sure, I doubt that it will interest people who don't have Visual Studio, but for developer who are used to it, it's a great choice, I think.

It offers solution and project management, IntelliSense, built-in Apache and PHP (you can work with an external server as well), DBG and xDebug debuggers I especially love its debugging features because I deal with the Visual Studio debugger that I love very much. I suppose VS lovers are going to appreciate this feature.

So, if you are a programmer who use Visual Studio and love it and have to use PHP as well, then I think you should give VS.PHP (yeah, that's how it is called) a try. It's available for both Visual Studio 2005 and 2008. There is a 30 days trial. While the full version costs only $99.99 that is not that much comparing to other PHP IDEs, like Zend Studio or NuSphere PHPEd.

I almost forgot to mention, it has built-in Zend Framework as well :-)!


Posted by Mike Borozdin on Sunday, September 07, 2008 9:46 PM GMT
Bookmark on MSDN   Add to Technorati Favorites  Kick it!  
Permalink | Comments (3) | Post RSSRSS comment feed

C++ Programming Language Still Rocks

Even though I don't program with C++ much these days, I still love the book entitled "C++ Programming Language" by Bjarne Stroustrup - the creator of the C++ programming language. Its first edition was published in 1986, but the book still remains informative even for non-C++ programmers.  Unlike many other programming books, this one doesn't focus only on the language itself,  in contrast, there are many very useful chapters on various programming paradigms, including the object oriented one, for sure. Besides, it does really explain the purpose of the object oriented method and its benefits. Moreover, there is information on software architecture, class design and on programming process as a whole.

The reason why I fetched it from my bookshelf was the constant questions in programming forums about benefits of OOP. The object oriented way of programming seems to be very natural for me, however I decided to prove my thoughts about OOP by consulting an authoritative source. The book by Bjarne Stroustrup who was one of the founders of object oriented programming is that authority source. While reading this book I recognized many contemporary patterns and principles, although Bjarne Stroustrup never calls them with the names they have today.

Nowadays there are a lot of books on design patterns, programming principles and etc that use Java or .NET as an example, however C++ is also an excellent example, simply because it was the language that inspired the Java and C# creators. So, this particular book is written by the real father of the modern programming principles, even if he is not considered to be fashionable today. Therefore, it can be recommended to any programmer, no matter which language they use.


Posted by Mike Borozdin on Thursday, September 04, 2008 7:19 PM GMT
Bookmark on MSDN   Add to Technorati Favorites  Kick it!  
Permalink | Comments (7) | Post RSSRSS comment feed

Microsoft Launch Social Bookmarking Service for IT Professionals

There is a preview version only, but the release version will come soon, I think it looks very promising.

Here is a quote from their blog:

Microsoft is opening up the MSDN, TechNet, and Expression sites to the community, so that technical professionals can better connect with each other, share knowledge, and succeed. Tagging - and especially social bookmarking - are essential ingredients for making this happen.

Back in May, just before TechEd North America, we released a preview version of our new social bookmarking app for MSDN, for TechNet, and for Expression. Since then, thousands of technical professionals from around the world have begun using it to save their web favorites online, share them with others, see what other technical pros are favoriting, and connect with others.

We also got a lot of great feedback on the app itself (thank you!) and I'm happy to say that in early September, we plan on releasing a full version of the app - v 1.0. Here are some new things to look for:

  • Subscribe to Tags or People: Find a tag you want to follow? Or a fellow bookmarker that bookmarks really good stuff? With the new app, it will be easy to get an RSS subscription for that tag or person (as in, click the orange button).
  • Browse & Find Users: Search or browse to find people by their display name (e.g., mine is "johmar") and other criteria.
  • Import Tools: Recognizing that a lot of people already have favorites saved in their browsers or in other social bookmarking sites, the new app will provide a tool for importing your favorites from Microsoft Internet Explorer and from Delicious.
  • Bookmarking Widget: If you have your own blog or other website, our new bookmarking widget will make it easy for people to bookmark your pages directly to their social bookmarks on MSDN, TechNet, or Expression. You'll get traffic from Microsoft when your bookmarked page is published in "social feeds" on our global sites.

Availability in 12 Languages: With the September release, the social bookmarking application will be available in Chinese (Simplified and Traditional), Czech, English, French, German, Italian, Japanese, Korean, Portuguese, Russian, and Spanish.

http://blogs.technet.com/johmar/archive/2008/08/21/preview-full-release-of-social-bookmarking-on-msdn-and-technet.aspx

I seem to be among the first to add their bookmarking widget to my blog. Actually, I have to create this widget on my own, because their widgets will be shipped with the 1.0 version only.

Here is the code of my widget:

<a href="http://social.msdn.microsoft.com/bookmarks/en-US/action/Create/s/E/?url=___URL___&ttl=___TITLE___">
    Bookmark on MSDN
</a>
I think everyone should try it. Just navigate your browser to - http://social.microsoft.com/bookmarks/

Posted by Mike Borozdin on Monday, September 01, 2008 12:07 PM GMT
Bookmark on MSDN   Add to Technorati Favorites  Kick it!  
Permalink | Comments (2) | Post RSSRSS comment feed