Letters from Readers

ViewModel Questions

Benjamin Day's exploration of leveraging the ViewModel in Silverlight and Windows Phone 7 development ("6 MVVM Tips") generated plenty of feedback.

Really great article overall, but I must advise caution with Tip 6. I agree completely that it's well worthwhile to create a design where you can have a custom entry control that displays the prompt, input control, validation message and so on in a consistent and reusable way. However, I see way too many architecture models where the business rules are coded in the ViewModel, and that's the only place they exist. Well, except for the next UI that uses the same data, and the one after that, and the service API after that and so on.

We must be vigilant to keep that code pushed well down the stack, deep into the Model where it belongs. Then, a model like the one described in Tip 6 can be a way to automate and facilitate the UI discovering and honoring them. It should not be a way to make doing the wrong thing easier.

Dan

Love for LINQ
Peter Vogel's Practical .NET column in the April issue on using Language Integrated Query ("Why You Really Should Be Using LINQ") produced a discussion of the performance of LINQ and, in particular, LINQ-to-SQL.

In my opinion, the best thing about LINQ is it speeds development. The best thing about LINQ-to-SQL is it speeds development without getting tied to an all-encompassing OR/M. If you build line-of-business solutions where the client states that every feature is vital, then building the features with LINQ and LINQ-to-SQL gives speed and agility. And when the client starts using the app and works out what the truly important features are, then it's easy to get in and optimize the plumbing that supports them.

Mike
Brisbane, Australia

Peter Vogel responds:
Interesting view: "LINQ as a rapid application development tool." I'm not as much of a fan of LINQ-to-SQL as you are, but that probably reflects that I'm an independent consultant: Not all of my clients use SQL Server and I miss LINQ when working on their projects. I'm really looking forward to seeing Oracle deliver LINQ support in the spring. LINQ-to-SQL has, however, a major feature that the Entity Framework does not: With the Entity Framework, only LINQ keywords that can be directly translated into SQL are supported. LINQ-to-SQL is far more flexible on that ground.

About the Author

This story was written or compiled based on feedback from the readers of Visual Studio Magazine.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube