Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: Data type lost when convertingto XML Pin
Heath Stewart20-Jan-04 4:05
protectorHeath Stewart20-Jan-04 4:05 
Generalcontrol in menu Pin
Mohamad Al Husseiny19-Jan-04 20:27
Mohamad Al Husseiny19-Jan-04 20:27 
GeneralInstaller startmenu question Pin
joepardue19-Jan-04 16:10
joepardue19-Jan-04 16:10 
GeneralRe: Installer startmenu question Pin
Shahin7719-Jan-04 17:46
Shahin7719-Jan-04 17:46 
GeneralRe: Installer startmenu question Pin
Heath Stewart19-Jan-04 20:23
protectorHeath Stewart19-Jan-04 20:23 
GeneralRe: Installer startmenu question Pin
joepardue20-Jan-04 4:23
joepardue20-Jan-04 4:23 
QuestionHow to get the target that *.lnk link to Pin
god4k19-Jan-04 16:07
god4k19-Jan-04 16:07 
GeneralImages, SQL and C# -PLEASE HELP Pin
Peter Greenall19-Jan-04 14:28
Peter Greenall19-Jan-04 14:28 
GeneralRe: Images, SQL and C# -PLEASE HELP Pin
Heath Stewart19-Jan-04 19:53
protectorHeath Stewart19-Jan-04 19:53 
GeneralRe: Images, SQL and C# -PLEASE HELP Pin
Peter Greenall20-Jan-04 1:05
Peter Greenall20-Jan-04 1:05 
GeneralRe: Images, SQL and C# -PLEASE HELP Pin
Jose Fco Bonnin20-Jan-04 5:41
Jose Fco Bonnin20-Jan-04 5:41 
General(?) about transfering to C# Pin
Snyp19-Jan-04 14:02
Snyp19-Jan-04 14:02 
GeneralRe: (?) about transfering to C# Pin
Heath Stewart19-Jan-04 19:41
protectorHeath Stewart19-Jan-04 19:41 
GeneralPerformance issues Pin
lpRomang19-Jan-04 10:54
lpRomang19-Jan-04 10:54 
GeneralRe: Performance issues Pin
leppie20-Jan-04 6:26
leppie20-Jan-04 6:26 
GeneralSharing Crystal Reports Documents between .Net and Delphi. Pin
Shahin7719-Jan-04 9:37
Shahin7719-Jan-04 9:37 
Generalmemory problems!! Pin
abc87619-Jan-04 9:30
abc87619-Jan-04 9:30 
GeneralRe: memory problems!! Pin
Heath Stewart19-Jan-04 19:31
protectorHeath Stewart19-Jan-04 19:31 
QuestionConvert a bitmap with 24bpp Pixel Format into 1bppIndexed Pixel format?? Pin
FiDz19-Jan-04 8:41
FiDz19-Jan-04 8:41 
AnswerRe: Convert a bitmap with 24bpp Pixel Format into 1bppIndexed Pixel format?? Pin
Mazdak19-Jan-04 8:52
Mazdak19-Jan-04 8:52 
AnswerRe: Convert a bitmap with 24bpp Pixel Format into 1bppIndexed Pixel format?? Pin
leppie20-Jan-04 6:35
leppie20-Jan-04 6:35 
QuestionSystem.Activator() - Performance issue? Pin
Jonas Follesø19-Jan-04 8:27
Jonas Follesø19-Jan-04 8:27 
Hi.

I'm working on a small Guestbook component. I want to make this component as good as possible and realy re-usable. I have a public class called GuestbookLogic exposing all the methods needed to get messages, add new messages and so on. The GuestbookLogic class have a prive property called Dalc. The Dalc property is of type IDalc.

IDalc is a public interface defining all the methods needed by the Data Access Layer Component to be compatible with the bussines logic. In the component i have two implementations of IDalc, SqlDalc and OleDbDalc. The reason i did this was to enable the users of the component to implement any DALC. For instance, if you want to use XML as your data layer, you could create a XmlDalc by implementing IDalc.

My problem is how you tell the bussines logic which implementation of IDalc to use. At the moment i have some logic in the get {} method of the private IDalc property. What it does is to check if the private dalc == null, if it is, then create a new instance of IDalc based on values in app/web.config. It creates the instance like this:

<br />
dalc = (IDalc)System.Activator.CreateInstance(Type.GetType(System.Configuration.ConfigurationSettings.AppSettings["GreIT.Guestbook.Dalc"]));				<br />


The GreIT.Guestbook.Dalc propery have this value: "GreIT.Guestbook.SqlDalc, GreIT".

My question is: say you use this component on a ASP.NET app. Would using System.Activator be a performance issue? Do you have any other ideas on how to plug in the IDalc implementation? I could have a set of pre-defines properties, and then have some logic like this.

<br />
string dalcSetting = System.Configuration.ConfigurationSettings.AppSettings["dalc"];<br />
<br />
if(dalcSettings.Equals("Sql")) dalc = new SqlDalc(); <br />
else dalc = new OleDbDalc();<br />


The problem with this implementation is that the developers using the component wouldn't be able to plug in IDalc implementations of their own. Sigh | :sigh:
AnswerRe: System.Activator() - Performance issue? Pin
Heath Stewart19-Jan-04 9:13
protectorHeath Stewart19-Jan-04 9:13 
GeneralRe: System.Activator() - Performance issue? Pin
Jonas Follesø19-Jan-04 9:54
Jonas Follesø19-Jan-04 9:54 
Generalabout reports Pin
Dimitris Iliopoulos19-Jan-04 6:07
Dimitris Iliopoulos19-Jan-04 6:07 

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.