Hi,
I thought I would post this suggested improvement to your DAL Factories, as it would simplify your code, while still providing the current functionality..
You've currently got 1 factory class for each DAL Interface. If you use the following class, which utilises generics, you can replace all of them with just the one class..
// DALFactory.cs
namespace Votations.NSurvey.DALFactory
{
using System;
using System.Collections.Specialized;
using System.Configuration;
using System.Reflection;
using Votations.NSurvey.IDAL;
public class DALFactory<T>
{
public static T Create()
{
NameValueCollection config = (NameValueCollection)ConfigurationManager.GetSection("nSurveySettings");
if (config == null)
{
config = ConfigurationManager.AppSettings;
}
string assemblyString = config["WebDAL"];
string typeName = assemblyString + "." + typeof(T).Name.ToString().Substring(1);
return (T)Assembly.Load(assemblyString).CreateInstance(typeName);
}
}
}
This class could then be called from any of the BusinessRules or DataAccess classes as follows..
DALFactory< *YOUR INTERFACE *>.Create(). * FUNCTION CALL *
eg..
DALFactory<IVoter>.Create().DeleteVoterResumeSession(surveyId, resumeUId);
Hope this helps..
grakenmol..