Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: about reports Pin
Guillermo Rivero19-Jan-04 6:14
Guillermo Rivero19-Jan-04 6:14 
Generalprinting with CrystalReportsViewer Pin
troels_sorensen19-Jan-04 4:12
troels_sorensen19-Jan-04 4:12 
GeneralRe: printing with CrystalReportsViewer Pin
Heath Stewart19-Jan-04 4:50
protectorHeath Stewart19-Jan-04 4:50 
GeneralRe: printing with CrystalReportsViewer Pin
troels_sorensen19-Jan-04 5:26
troels_sorensen19-Jan-04 5:26 
GeneralInitialised data in C structures using C# Pin
Member 55383319-Jan-04 4:10
Member 55383319-Jan-04 4:10 
GeneralRe: Initialised data in C structures using C# Pin
Heath Stewart19-Jan-04 4:42
protectorHeath Stewart19-Jan-04 4:42 
GeneralRe: Initialised data in C structures using C# Pin
Member 55383319-Jan-04 6:07
Member 55383319-Jan-04 6:07 
GeneralRe: Initialised data in C structures using C# Pin
Not Active19-Jan-04 9:04
mentorNot Active19-Jan-04 9:04 
GeneralRe: Initialised data in C structures using C# Pin
Heath Stewart19-Jan-04 9:06
protectorHeath Stewart19-Jan-04 9:06 
GeneralRe: Initialised data in C structures using C# Pin
Not Active19-Jan-04 9:35
mentorNot Active19-Jan-04 9:35 
GeneralSerial port comms Pin
tim_mid19-Jan-04 3:11
tim_mid19-Jan-04 3:11 
GeneralRe: Serial port comms Pin
troels_sorensen19-Jan-04 4:15
troels_sorensen19-Jan-04 4:15 
GeneralURGENT...problem with Windows Media Player ! Pin
pahluwalia19-Jan-04 2:54
pahluwalia19-Jan-04 2:54 
GeneralRe: URGENT...problem with Windows Media Player ! Pin
Not Active19-Jan-04 2:57
mentorNot Active19-Jan-04 2:57 

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.