2 Removed references to the use of MEF and Prism frameworks, not really correlated to the problem
source | link

Background

I am developing a WPF project using the Microsoft Extensibility Framework.

This is the basic structure:

  • User Interface (WPF Project);
  • MEF InterfacesInterfaces (class library, contains all the interfaces and the entities used by the applicationapplication;
  • Modules loaded using MEF (or in some case Prismevery module contains the logic of a specific argument, e.g. File Management, and can eventually contains Wpf User Controls).

In the WPF Controls, to facilitate the binding operations I have created a BaseViewModel class which contains a Raise method that automates the binding mechanism (for further details, I used a technique similar to that one described in this article).


The problem

Understand which is the best way to separate Presentation form from the Business form in the entities classes.


The case

In the MEF InterfacesInterfaces project I have, for exampleinstance, the class UserUser

public class User
{
    public virtual string Name { get; set; }

    // Other properties
}

In one of the modules I need to use the UserUser class and to bind its properties to the User Interface controls. To do so I have to use a custom implementation of the get and set keywords.

At first point, I thought to create a class in the Module called, for instance, ClientUser and override the properties that I need:

public class ClientUser : User 
{
    private string name;

    public override string Name { get { return name; } set { Raise(out name, value); } }

    // Other properties
}

The problem is the Raise method, which is declared in the BaseViewModel class, but due to C# single inheritance constraint, I can't inherit from both classes.

Which is the right way to implement this architecture?

Background

I am developing a WPF project using the Microsoft Extensibility Framework.

This is the basic structure:

  • User Interface (WPF Project)
  • MEF Interfaces (class library, contains all the interfaces and the entities used by the application
  • Modules loaded using MEF (or in some case Prism)

In the WPF Controls, to facilitate the binding operations I have created a BaseViewModel class which contains a Raise method that automates the binding mechanism (for further details, I used a technique similar to that one described in this article)


The problem

Understand which is the best way to separate Presentation form from the Business form in the entities


The case

In the MEF Interfaces project I have for example the class User

public class User
{
    public virtual string Name { get; set; }

    // Other properties
}

In one of the modules I need to use the User class and to bind its properties to the User Interface controls. To do so I have to use a custom implementation of the get and set keywords

At first point, I thought to create a class in the Module called, for instance, ClientUser and override the properties that I need:

public class ClientUser : User 
{
    private string name;

    public override string Name { get { return name; } set { Raise(out name, value); } }

    // Other properties
}

The problem is the Raise method, which is declared in the BaseViewModel class, but due to C# single inheritance constraint, I can't inherit from both classes.

Which is the right way to implement this architecture?

Background

I am developing a WPF project.

This is the basic structure:

  • User Interface (WPF Project);
  • Interfaces (class library, contains all the interfaces and the entities used by the application;
  • Modules (every module contains the logic of a specific argument, e.g. File Management, and can eventually contains Wpf User Controls).

In the WPF Controls, to facilitate the binding operations I have created a BaseViewModel class which contains a Raise method that automates the binding mechanism (for further details, I used a technique similar to that one described in this article).


The problem

Understand which is the best way to separate Presentation form from the Business form in the entities classes.


The case

In the Interfaces project I have, for instance, the class User

public class User
{
    public virtual string Name { get; set; }

    // Other properties
}

In one of the modules I need to use the User class and to bind its properties to the User Interface controls. To do so I have to use a custom implementation of the get and set keywords.

At first point, I thought to create a class in the Module called, for instance, ClientUser and override the properties that I need:

public class ClientUser : User 
{
    private string name;

    public override string Name { get { return name; } set { Raise(out name, value); } }

    // Other properties
}

The problem is the Raise method, which is declared in the BaseViewModel class, but due to C# single inheritance constraint, I can't inherit from both classes.

Which is the right way to implement this architecture?

    Post Migrated Here from codereview.stackexchange.com
1
source | link

Organizing Business and Presentation entities

Background

I am developing a WPF project using the Microsoft Extensibility Framework.

This is the basic structure:

  • User Interface (WPF Project)
  • MEF Interfaces (class library, contains all the interfaces and the entities used by the application
  • Modules loaded using MEF (or in some case Prism)

In the WPF Controls, to facilitate the binding operations I have created a BaseViewModel class which contains a Raise method that automates the binding mechanism (for further details, I used a technique similar to that one described in this article)


The problem

Understand which is the best way to separate Presentation form from the Business form in the entities


The case

In the MEF Interfaces project I have for example the class User

public class User
{
    public virtual string Name { get; set; }

    // Other properties
}

In one of the modules I need to use the User class and to bind its properties to the User Interface controls. To do so I have to use a custom implementation of the get and set keywords

At first point, I thought to create a class in the Module called, for instance, ClientUser and override the properties that I need:

public class ClientUser : User 
{
    private string name;

    public override string Name { get { return name; } set { Raise(out name, value); } }

    // Other properties
}

The problem is the Raise method, which is declared in the BaseViewModel class, but due to C# single inheritance constraint, I can't inherit from both classes.

Which is the right way to implement this architecture?