Click here to Skip to main content
15,886,810 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Thoughts on Authorization in a Hierarchical User Structure. Pin
Eddy Vluggen2-Dec-12 2:56
professionalEddy Vluggen2-Dec-12 2:56 
GeneralRe: Thoughts on Authorization in a Hierarchical User Structure. Pin
Brady Kelly2-Dec-12 3:06
Brady Kelly2-Dec-12 3:06 
GeneralRe: Thoughts on Authorization in a Hierarchical User Structure. Pin
Eddy Vluggen2-Dec-12 3:34
professionalEddy Vluggen2-Dec-12 3:34 
QuestionA MEF Question - Refering base classes without adding reference to a dll. Pin
John T.Emmatty29-Nov-12 22:25
John T.Emmatty29-Nov-12 22:25 
AnswerRe: A MEF Question - Refering base classes without adding reference to a dll. Pin
Eddy Vluggen1-Dec-12 5:30
professionalEddy Vluggen1-Dec-12 5:30 
QuestionHand Gesture Recognition System Pin
Member 916988728-Nov-12 3:00
Member 916988728-Nov-12 3:00 
AnswerRe: Hand Gesture Recognition System Pin
Eddy Vluggen1-Dec-12 5:27
professionalEddy Vluggen1-Dec-12 5:27 
QuestionMoving code from a Window/UserControl to outside in order to make it reusable! Pin
Praveen Raghuvanshi27-Nov-12 6:48
professionalPraveen Raghuvanshi27-Nov-12 6:48 
Hi,

I have a usercontrol in my WPF application, and there is a code behind file suppose EmployeeEditor.xaml.cs which has some code to modify.
For e.g;
I have a Employee as defined below

Class Employee
{
public string Name {get; set;}
public uint Id {get; set;}
}

I have a UserControl to edit the Employee information which has EmployeeEditor.xaml and EmployeeEditor.xaml.cs

There are methods in EmployeeEditor class to modify the list of employee
- AddEmployee()
- RemoveEmployee()
- RenameEmployee()

These methods has business logic to update the information in the data object/database.

The life of EmployeeEditor class is till the user control is displayed and it dies on closing it.

I wanted to move above methods outside this class, so that they can be used elsewhere in a functionality such as Undo/Redo which will create/delete an employee using AddEmployee/RemoveEmployee methods.

One solution is to move those methods to a helper which i don't feel to be appropiate as I need to pass all the dependencies of AddEmployee() method as a parameter.
Other solution can be to create a separate class to which will perform all the operations and keep the dependencies.

Please let me know if this problem fits into any design pattern and what could be the better solution?

Thanks in advance!
AnswerRe: Moving code from a Window/UserControl to outside in order to make it reusable! Pin
Eddy Vluggen1-Dec-12 5:25
professionalEddy Vluggen1-Dec-12 5:25 
GeneralRe: Moving code from a Window/UserControl to outside in order to make it reusable! Pin
Praveen Raghuvanshi9-Dec-12 4:46
professionalPraveen Raghuvanshi9-Dec-12 4:46 
Questionhow to show database table in a class diagram Pin
Qobacha24-Nov-12 22:49
Qobacha24-Nov-12 22:49 
AnswerRe: how to show database table in a class diagram Pin
jschell25-Nov-12 5:05
jschell25-Nov-12 5:05 
AnswerRe: how to show database table in a class diagram Pin
manoranjan25-Nov-12 5:46
manoranjan25-Nov-12 5:46 
AnswerRe: how to show database table in a class diagram Pin
VishwaKL27-Nov-12 20:51
VishwaKL27-Nov-12 20:51 
GeneralFile Directories Pin
strrom78-Nov-12 17:03
strrom78-Nov-12 17:03 
GeneralRe: File Directories Pin
Richard MacCutchan8-Nov-12 23:41
mveRichard MacCutchan8-Nov-12 23:41 
GeneralRe: File Directories Pin
strrom79-Nov-12 18:08
strrom79-Nov-12 18:08 
GeneralRe: File Directories Pin
Richard MacCutchan9-Nov-12 23:25
mveRichard MacCutchan9-Nov-12 23:25 
QuestionUsing WCF and RESTFUL api in a legacy system Pin
Md. Marufuzzaman5-Nov-12 1:24
professionalMd. Marufuzzaman5-Nov-12 1:24 
AnswerRe: Using WCF and RESTFUL api in a legacy system Pin
Eddy Vluggen5-Nov-12 2:24
professionalEddy Vluggen5-Nov-12 2:24 
GeneralRe: Using WCF and RESTFUL api in a legacy system Pin
Md. Marufuzzaman5-Nov-12 5:07
professionalMd. Marufuzzaman5-Nov-12 5:07 
GeneralRe: Using WCF and RESTFUL api in a legacy system Pin
Eddy Vluggen5-Nov-12 5:23
professionalEddy Vluggen5-Nov-12 5:23 
GeneralRe: Using WCF and RESTFUL api in a legacy system Pin
Md. Marufuzzaman5-Nov-12 7:04
professionalMd. Marufuzzaman5-Nov-12 7:04 
GeneralRe: Using WCF and RESTFUL api in a legacy system Pin
Eddy Vluggen5-Nov-12 7:49
professionalEddy Vluggen5-Nov-12 7:49 
GeneralRe: Using WCF and RESTFUL api in a legacy system Pin
Md. Marufuzzaman5-Nov-12 8:21
professionalMd. Marufuzzaman5-Nov-12 8:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.