Advertisement

04.18.2008 at 05:25AM PDT, ID: 23333908
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Factory Pattern Implementation

Asked by hazarasp in Design & Methodology, C# Programming Language

Tags:

Hi,
I wanna discuss something about general Action-Role section of the security module. Normally I use to make data tables in database for Actions, Roles and Action-Role mapping for the security module of the project.
Actions like- CanReadMail, CanReplyMail, CanForwardMail etc...
Roles like- Trainer, Agent, Supervisor, Manager etc...
A role may have multiple actions like- an Agent can ReadMail as well as can ReplyMail.
This is how I was doing it so far...but now what we r trying to do is we r trying to implement Factory pattern for this as...

//Product                                                                    //Creator
interface IAction                                                        abstract class Role
{                                                                                 {
}                                                                                      List lstActions;
                                                                                        //constructor
                                                                                        Role() { AddActions(); }
//Concrete Product
class CanReadMail : IAction                                            //virtual function
{                                                                                       virtual AddActions();
}                                                                                 }

class CanReplyMail : IAction                                      //Concrete Creator
{                                                                                  class Trainer : Role
}                                                                                   {
                                                                                           override AddActions()
class CanForwardMail : IAction                                          {
{                                                                                                    lstActions.Add(new CanReadMail());
}                                                                                           }
                                                                                    }


                                                                                   class Agent : Role
                                                                                   {
                                                                                           override AddActions()
                                                                                               {
                                                                                                    lstActions.Add(new CanReadMail());
                                                                                                    lstActions.Add(new CanReplyMail());
                                                                                               }
                                                                                    }


                                                                                   class Supervisor : Role
                                                                                   {
                                                                                           override AddActions()
                                                                                               {
                                                                                                    lstActions.Add(new CanReadMail());
                                                                                                    lstActions.Add(new CanForwardMail());
                                                                                               }
                                                                                    }

As Actions and Roles are not going to be changed more or less. I mean right now it's said that current solution's requirement is only this much of roles and actions. But as we all know in software industry change in customer requirement is always expected-may be in 6 months or a year or 2.

So my query is,will it be a good approach to go for class representation (Factory Pattern) of the Actions and Roles in this case or database approach will be much better.
One more thing, I am unable to find a good practical approach to implement Factory Pattern. If somebody can help me out with some good example.
Thanx a lot for going through my query. Ur suggestions are precious for me.

Regards
Hazara SinghStart Free Trial
 
Loading Advertisement...
 
[+][-]04.18.2008 at 05:36AM PDT, ID: 21385184

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Design & Methodology, C# Programming Language
Tags: c#
Sign Up Now!
Solution Provided By: LordThlan
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.18.2008 at 05:51AM PDT, ID: 21385273

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 05:52PM PDT, ID: 21416888

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 11:31PM PDT, ID: 21418152

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 02:17AM PDT, ID: 21428866

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.28.2008 at 12:15AM PDT, ID: 21452042

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 05:03AM PDT, ID: 22288826

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08.28.2008 at 02:24AM PDT, ID: 22332910

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628