Best Design Pattern for a WPF MVVM application

guilhermecgs

I´m developping a project using WPF + MVVM. The program needs to load objects (cases) from a repository and allow the user to edit it. The main functionalities are:

  • CRUD of cases
  • Know which cases have been loaded
  • Know which case is currently selected

Currently, the version 0.1 uses a singleton class Session (in namespace model) to store a list from all cases loaded.

There is also a "Case Management" service that perform several operations in the Session singleton:

  • Load a case from the repository and store it in Session
  • Remove cases
  • Verify if a case is valid
  • Select a case for editing

I´m new to WPF, and I would like to know if there is a design pattern that is suitable for this situation. I´m afraid that I´m not going to the right direction.

I dont know if I have provided all information needed, but I´m willing to answer any question as fast as I can.

Here if a prototype

Example of a Load operation

Ibrahim Najjar

Your design is fine, i can't see anything wrong.

I would suggest one thing though, get rid of that singleton session object and use dependency injection, and let the DI container decide what life strategy to use for the Session object at the application composition root.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Best way to implement navigation in mvvm for wpf application

From Dev

Control in wpf and in mvvm pattern

From Dev

Design pattern best practices

From Dev

Is MVVM design pattern supported by JSF?

From Dev

Confirmation Window In MVVM design pattern

From Dev

Change ItemContainerStyle of ListBox MVVM in WPF MVVM Pattern

From Dev

WPF DataBinding ListBox in MVVM Pattern

From Dev

WPF DataBinding ListBox in MVVM Pattern

From Dev

Design pattern for application time?

From Dev

In WPF application using MVVM pattern On button click need to show alert box?

From Dev

Best design pattern for event listeners

From Dev

MVP design pattern best practice

From Dev

best pattern design for my project

From Dev

Issues with validating MVVM WPF Application

From Dev

Basic guidance require for MVVM design pattern

From Dev

MVVM design pattern relation between ViewModel and Model

From Dev

WPF: How use MVVM pattern correctly

From Dev

WPF Navigate through views using MVVM pattern

From Dev

Checkboxes and Custom List in WPF with MVVM Pattern

From Dev

Loading asynchronously in a UserControl WPF with MVVM pattern

From Dev

WPF, MVVM design lengthy binding consideration

From Dev

Situation based design pattern application

From Dev

Would the MVVM pattern be appropriate for this application's requirements?

From Dev

Best design pattern for switching between hardware interfaces

From Dev

What is best Ruby Class design / pattern for this scenario?

From Dev

Best OOP design pattern for static class DbTable

From Dev

Best Design Pattern to execute steps in python

From Dev

Working with local ViewModel in MVVM WPF application

From Java

How to handle dependency injection in a WPF/MVVM application

Related Related

HotTag

Archive