Thursday, November 01, 2007

I've found that the best resource for learning about ENtity Framework is in the forums. Today I finally saw a public statement about something I"ve been waiting for for a long time.

Brian Dawson says:

We've been working on making the WCF experience, especially with relationships, a much better experience no matter which serialization scheme you choose. Binary serialization has been working already, but in the cases where we are doing other types of serialization, dealing with relationships was tricky and we purposely don't deal with deep serialization, at least in this release. What we did do was add the EntityKey as a serializational property on the relationship reference. This way, if you serialize Product, you'll get the EntityKey for Category. You can treat the CategoryReference.EntityKey  similar to a foreign key. Basically, this allows you to fetch entities with the key, and also do updates and deletes without having to rebuild all the dependant ends.  We are targeting Beta3 for some additional information in this specific area.

What he's talking about is this: when you do binary serliaziont of an object graph (i.e. and entity and anything that is attached to it) you get the whole thing, but if you do xml serialization, you only get the entity. That makes doing web services a nightmare. I have written a few posts about dealing with this using the current Beta 2 bits of Entity Framework. Here's the critical one : XML Serializing Entity Framework Entities With Their Children For SOA.

Another critical problem is that you lose all of your statemanagement. Here's a post I wrote about how to recreate state so tha tyou can do updates, etc. More on Disconnected Entity Framework

If you watch the forums you may have noticed that there have been a lot of people hammering on the team. On one thread about this topic which I would not let go, Danny SImmons finally responded:

This thread is getting way out of hand, and clearly we need to get some better guidance together on all of this (a few good blog posts at least).  

So, instead of writing blog posts and guidance (unless you count mine) they went to work on the bits! Happily they are going to make it a lot easier in Beta 3 enabling us to not only rebuild full graphs, but reconstituting the state.

Thursday, November 01, 2007 1:35:28 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

In the past month (plus a few days), I have flown across the country twice (one was an overnight trip to San Diego for an INETA talk, the other was for a few days for some training in Redmond at Microsoft) and driven to Boston twice (4 hours each way, once for COde Camp, and then again for REMIX) and Montreal once for a user group meeting.

STill ahead of me in the next month (plus a few days) are three more cross country trips. Las Vegas for DevConnections, Vancouver for DevTeach and then back to Seattle for another quickie trip.

(And before you ask, no, I am not interviewing. You should know me better than that by now. :-) I'm just trying to learn a thing or two and rack up those miles.)

Thursday, November 01, 2007 11:59:02 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

A few days ago I got an email from the Sr. Editor of ComputerWorld who was interested to learn what had become of the group of Vermont software companies that had banded together a few years ago. He was referring to the Vermont Software Developer Alliance an organization who's board I have served on since it began over three years ago.

I passed him on to our new Executive Director, Patrick Martell and only days later, this story appeared in Computerworld. Cool!

Green thinking vs. great access: A tale of two high-tech contenders
Ambitious Vermont needs what Westchester County, N. Y., has: broadband

Thursday, November 01, 2007 11:21:11 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Wednesday, October 31, 2007

I had to figure this out, so here are a billion screenshots so anyone who wants to do this will have an easier time of it!

One of the niceties about being able to customize your conceptual models is not having to bother the dba while they are doing important things like indexing tables and optimizing the database. If you find you have some tables that came into your entity data model that have primary/foreign key relationships that were never defined in the database, then the wizard won't have built associations for you.

Imagine I have two entities, client and title. A client has many titles (kinda like a publisher but I used a different db for my example, so just live with "client".) The title entity has a property called clientid. I want to build an association between the two

Right click in the model (white area, not on an entity) and you will get a context menu. Select Add, then Association.

This little window will pop up. It will default the two ends populated with the first two alphabetical entities.

Use the dropdowns in End Entity to change the two end points. I made mine CLient and Title.

The multiplicity options are 1, Zero or One and Many. My relationship is that is one to many, but I can have titles that don't have a client, so I'm choosing 0..1 for the client and * for the title.

I changed the names of the navigation properties. They started out as Title and Client1. When I'm working with a client, I want to see a property called Titles. (Client.TItles) and title only has one client, so these are the names I want, Titles and Client.

Next is a step that may not make sense but you need to delete the "clientid" property in the title entity. Because of this association, the clientid has a job now and doesn't belong as a property. (This is debatable and there have been requests to modify this rule for EDMs, but right now, that's the way it works. You can read more about why in this blog post.)

Now to the mappings. We have told the entities that they are related but they don't know the basis for their relationship. This happens in the mappings where we wire things up to the representation of the database that is part of the EDMX file created by the wizard.

Right click in the model again and choose Show Entity Mapping Details.

You'll see an almost empty view, that has only Association and under it <Add a Table or View>. Click on Add a Table or View. Choose one of the entities. This is a little confusing here and I have actually made a suggestion in the forums to simplify it, but just go with the flow.

You'll get a default that shows the end points you identified in the association and most likely you'll see id's on the left and id's on the right. The "id" on the left refers to the property of the end point. The one on the right refers to the column in the database table (literally the store entity, but db table is easier to grok in this case) that you are mapping to. SO that's why you see that I have changed my mapping so that client's id property will map to the client id field in "the other end of the association", e.g. the Title. Then the title end point (End2) will map over to the id of the other endpoint (client).

Now here's a small bug with the designer, even if I choose clientid from the drop down list under column, it doesn't stick (remember, the tool is just a preview right now). I originally had gone into the raw xml to fix this, but thanks to a pointer by Philip in the comments, I see how to get around it more easily.

In the drop down, first choose <Delete>. Then there will be no column mapping for the client end point. Now drop down the list again and choosed clientid. This way it stays.

---------------------------------------
I'm going to leave the by-hand notes in here just for educational purposes.

So I had to doctor this up in the raw xml.

Luckily this was at the bottom of the whole xml file.

<AssociationSetMapping Name="ClientTitle" TypeName="EFSampleDatabaseModel.ClientTitle" StoreEntitySet="Titles" >
  <
EndProperty Name="Title"
>
    <
ScalarProperty Name="id" ColumnName="id"
/>
  </
EndProperty
>
  <
EndProperty Name="Client"
>
    <
ScalarProperty Name="id" ColumnName="clientid"
/>
  </
EndProperty
>
  <
Condition ColumnName="clientid" IsNull="false"
/>
</
AssociationSetMapping>

I've bolded the two changes I made. These were originally "id" because of the mapper problem.
---------------------------------------

The condition exists because it makes no sense to map titles that have null clientids.

Now I can write code like this and see the associations working

Dim oc As New EFSampleDatabaseModel.Entities
Dim q = From c In oc.Clients Select c, c.Titles

For Each c In q
  Console.WriteLine(c.Titles.Count)
Next

Wednesday, October 31, 2007 9:06:05 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

I pilfered this from my parent's website, www.BlueHeavenNewfoundlands.com. They are newfie breeders (mostly Landseers, like Rollo). Rollo is one of their puppies, now 8 years old, who is owned by a really neat lady who dances with her dogs competitively. Yes dances. She and Rollo were even on Nick at Nite and they compete in various "Freestyle" events. YOu can read more about that here. She dresses up her dogs for the dancing and also for pics like these - for Halloween, New Years and more. There's a page filled with them on my parent's site.

Wednesday, October 31, 2007 3:36:41 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Tuesday, October 30, 2007

I spent a lot of time coding in javascript for silverlight 1.0 and am having fun now getting back to managed code with 1.1. I'm even doing it all in C#, but the main reason is because I  have a lot of nearly reusable javascript code and it's just easier to port that to C#.

However, as usual, I am just diving head first and not doing too much advance research. Two things I learned the hard way:

Silverlight does not yet support LINQ
A few months ago, I spent bunch of time buliding a beatiful LINQ to XML method to build up some XAML by hand only to discovere when I tried to run it, that it failed. I looked around and discovered that LINQ support was not there yet. Oops! But it was my first time using LINQ to XML to build an XML document, so what I learned in the process was not a waste by any means.

Silverlight does not yet support WCF
I built a very nice WCF service, with composite types and everything only to learn (when I went to add service reference to my SL client) that it's not supported yet. There are a few workarounds, [here on the sliverlight forums] and [here in Luis Abreu's blog], but since this particular code will be for a conference demo and I don't want to add any extra layers of complexity, I will just go back to ASMX for this one.

Tuesday, October 30, 2007 11:25:21 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I spent a lot of time coding in javascript for silverlight 1.0 and am having fun now getting back to managed code with 1.1. I'm even doing it all in C#, but the main reason is because I  have a lot of nearly reusable javascript code and it's just easier to port that to C#.

However, as usual, I am just diving head first and not doing too much advance research. Two things I learned the hard way:

Silverlight does not yet support LINQ
I spent bunch of time buliding a beatiful LINQ to XML method to build up some XAML by hand. But it was my first time using LINQ to XML to build and XML document, so what I learned in doing that was not a waste by any means.

Silverlight does not yet support WCF
I built a very nice WCF service, with composite types and everything only to learn (when I went to add service reference to my SL client) that it's not supported yet. There are a few workarounds, [here on the sliverlight forums] and [here in Luis Abreu's blog], but since this particular code will be for a conference demo and I don't want to add any extra layers of complexity, I will just go back to ASMX for this one.

Tuesday, October 30, 2007 11:25:16 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Yes, you can have it all! Live in a cool place (Stowe, Vermont) and do the work you love surrounded by smart people!

 

(While you are at it, check out Springer-Miller, also in Stowe who, like Inntopia, has a sizable and brainy team of programmers.)

 

 

Inntopia in Stowe

 

APPLICATION DEVELOPERS
REQUIRED TECHNOLOGY EXPERTISE
4+ years experience in a majority of the following technologies

  • ASP.NET/C#
  • SQL/T-SQL
  • XML
  • XSL/XPath
  • AJAX / JavaScript
  • XHTML/DHTML
  • COM/DCOM
  • SOAP/Web Services

SOFTWARE TOOLS
Familiarity with the at least 2 of the following development applications:

  • Microsoft Visual Studio .NET 2003/2005
  • Microsoft SQL Server 2000/2005
  • XMLSpy
  • Visio

REQUIRED SKILLS

  • Ability to design, develop and maintain software on Microsoft .NET platform.
  • Ability to design and develop software in a group or independently.
  • Comfort with direct communication with all levels of technical and business resources.
  • Self-managing, self-motivated learner with good written and oral communication skills.

ADDITIONAL BENEFICIAL SKILLS

  • Travel/hospitality industry experience
  • Experience with high-volume transactional accounting systems (accounts receivable and accounts payable)
  • Experience with complex pricing and commission structures
  • Experience with security protocols (i.e. PCI Compliance and data encryption standards)
  • Experience with software development process management.
  • Experience developing multi-lingual web applications.

Email resume to lisa@inntopia.com

Tuesday, October 30, 2007 9:53:28 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, October 29, 2007

I'm not a big baseball fan, so I didn't even realize that the world series was already in play. This morning, I learned that the Red Sox had won yet another series (many Vermonters are big SOX fans) but the really big news this morning was that Lucy, a Holstein from Derby, Vermont, was crowned the "top female Holstein on the planet at the World Dairy Expo in Madison, WIsconsin. "On the planet"!

Here's the big news with a cute picture of Lucy.

Monday, October 29, 2007 8:21:45 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 
 Sunday, October 28, 2007

Yet another Flash driven advertisement (here are some others i've blogged about in the past) that uses annotation. Below is a screencast of me playing with this Notes ad (with a mouse, not a stylus). You can do this in Silverlight 1.0 and 1.1 with the InkPresenter. I'll be giving a session on Annotating in Silverlight as part of the Mobile Connections show during the big DevConnections conference next week (Nov 5 - 8) in Las Vegas.

Sunday, October 28, 2007 3:11:28 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

This is probably a temporary problem as I'm working with an alpha and a beta, and therefore my fix is a  probably a temporary hack. I always have to remember how to get XAML intellisense to work whenever I start a new Silverlight project. Here's how to do it.

[A New DevLife Post]

Sunday, October 28, 2007 11:30:11 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, October 27, 2007

Kathleen Dollard gave up the fight against spam on her self-hosted blog and has moved over to MSMVP Blogs.

Here new blog, Leaning Into Windows, can be found at http://msmvps.com/blogs/kathleen

Saturday, October 27, 2007 9:31:24 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

A few years ago, I wrote a little utility for one of my clients who uses Crystal Reports XI to design reports inhouse. They wanted other people on the corporate intranet to be able to see and refresh the reports and if necessary, enter new parameters. Since they weren't designing reports, it didn't make sense to buy licenses for everyone and I was able to (very easily) come up with a viewer utility that did the trick. I finally wrote this article about it for ASPAlliance, as they have a great collection of articles (mostly written by Eric Landes).

Writing a Viewer Utility for Crystal Reports

Saturday, October 27, 2007 1:31:39 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Leave it to CoDe Magazine to let me write about the problem some of us programmers have when we really have to pee, but we just want to get that last line of code working. I also talk about my own impatience and obsessions around programming and suggest that I might not be the only developer with these traits.

MVP Corner - Coder's Anonymous

It's in the current issue (Nov/Dec 2007) and is also now online.

Saturday, October 27, 2007 1:27:42 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

This article, Introducing ADO.NET Entity Framework, which I wrote for CoDe Magazine is now online.

You can find it in the Nov/Dec 2007 issue which is currently on newsstands (and highly likely to be at available at your local .NET User Group.)

Saturday, October 27, 2007 1:22:32 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I have been subscribed to this blog for Zlatkov which has was phased out in July and I didn't know he was going to resurface in a new blog. I just happened to come across that today! It is a focused Entity SQL blog

blogs.msdn.com/esql

Saturday, October 27, 2007 11:17:31 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

If you can't make it to DevConnections in Las Vegas where there will be a Data Access track with a whole bunch of Entity Framework session (check it out) and the reason is because you live over on the other side of the pond, there are a bunch of EF talks at TechEd Europe.

Mike Taulty lists them here.

Saturday, October 27, 2007 8:58:49 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Friday, October 26, 2007

From Jeff Beehler on Microsoft's VSTS team:

We recently discovered that the VPCs we distributed as part of the VS2008 Beta2 release will expire on Thursday, November 1, 2007, much earlier than we had originally expected.  Since the timeout is at the OS level, we cannot automatically extend the timeout period.  As such we are currently in the process of reissuing the VPCs and expect to make them available early next week.

In the meantime, for anyone that has stored information in TFS that they need to access moving forward, we recommend that you immediately backup the TFS databases in preparation to move them to the updated VPCs.  For information to complete these steps, please refer to the documentation on Moving Team Foundation Server.

We're still working on additional guidance to respond to this situation.  As more information becomes available, I'll post it here. 

Note this is NOT talking about regular installations but the actual VPCs

Friday, October 26, 2007 3:40:24 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

I came across an article about drawings being used rather than passwords for security on computers, etc. Read more here...

[A New DevLife Post]

Friday, October 26, 2007 1:06:08 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |