Being in New York has its many perks, one is the awesome big city an hour train ride away. This city and its surrounding area offer one of the biggest markets for technology in the world and it is no surprise that Microsoft has a tremendous presence here. I was informed of this event by my colleague here in New York, Anis. Upon seeing it I immediately registered, not just for its content, but also its location: At the Grand Hyatt in New York City next to Grand Central station. Any excuse I can find to go into the city is a valid one in my book.
I want to thank Peter Laudati, Stephen Bohlen, and Sara Chipps for taking the time to put on this wonderful event, while a lot of the information for me was review, it was still very helpful to get other people’s perspective on the technology as well as meet local members of the New York technology community.
I really enjoyed this session because it got me into thinking mode and finally got a design pattern to click in my head for MVC, I have to thank Stephen for this as he pointed out something that I was doing which I see now is a bit of an overstep in terms of the responsibility of the control. I assumed that I should use EF or L2SQL entity classes as the models that are passed to my strongly typed views. Stephen pointed out that why should I pass these objects, which contain so much extra information, to the model. Make simple versions, he said, and passed those.
At first I didn’t agree with this point as I thought it would lead to class clutter. But as I started to think about it I realized this is already what I am doing on the project out here in New York, where we use Linq2Sql unfortunately. When you look at the application the L2SQL entity NEVER leave the Model layer except as an anonymous object or as a simplified entity object (realizing this made me recognize some areas that should be refactored starting Monday). By using this approach with MVC we can open the ability to TRUELY leverage the idea of the Universal Model. Where a single View can be used by n controllers to display data.
Think about a maintenance screen for satellite data. Generally you just have a Name field and then your normal Create or Update logic. You could design a Web level model class with an interface that has the desired methods on it and simply work with that in the View passing it off as necessary without ever know what you are actually working with. In turn this would use just one view, and save you the headache of many satellite maintenance screens.
That aside, the majority of what was discussed was review, though the conversations were interesting and I was able to get to know a few of the local technologists. Thinking I may look into visiting the New York .NET User group.