Blog Articles

A collection of links to all my blog articles to make it easier for me to find the one I’m looking for.

WPF “Tutorial”

WPF Helpers

Other WPF

WPF Errors

Entity Framework


4 Responses to Blog Articles

  1. Avi says:

    this is a great blog. thank you.

  2. Anirban Paul says:

    I was searching for guidelines for having Data Access Layer in a MVVM application.Then I found your reply in the following link
    and I got what I was searching for. But I am not sure about how to incorporate the object of data access layer class in a view model that needs to access the DB data.Following are the options that come into my mind –
    1>object of data access layer class is a member field of the viewModel class and it is instantiated inside the constructor of the viewModel and lives till the viewmodel object lives.
    2> object of the data access layer class is a local member of the module[that needs DB data] of the ViewModel class and lives till the module lives. There are more than one such modules in one viewmodel class.
    3> Have an interface that the Data Access Layer class implements.
    Have reference of this interface as a member field of the ViewModel class. This reference is instanciated through Constructor Dependency Injection.
    Please suggest me the best way to resolve this issue.

    • Rachel says:

      Hi Anirban,

      There are many right ways to do things when programming, so simply choose the one that works best for you and your project.

      In a smaller applications, I find the simplest solution is often best, while in larger or more complex applications, separating the layers better makes it easier for maintaining later on.

      Typically I will create my DAL object when I need it, and keep it around as long as long as it’s needed. Once I’m done with it, it can be disposed of. Of course, that depends on the frequency at which I need to access the data, and the complexity of the application.

      So my suggestion would be to keep it simple at first, and only expand on it if needed.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: