S
Steve
Hi all,
I'm designing my DAL layer(s) for our suite of applications and I'm
designing myself in circles, it's gotten to the point where each idea just
mixes me up more
We have 3 loosely related applications and I would like to use an assembly
for the DAL in each of them. I have thought of using a single assembly for
all of them with several different classes for providers/application
specific code, thought of a separate assembly for each application, etc.
I have several questions that I'm hoping will lead to some clarity if I can
get them answered and hopefully you can help with some of the answers.
1) Is there a way to share .cs files across several projects? I'm used to
this with C++, but in c# it seems that this results in a copy of the files
into each project. Is there a way to reference a file from another project?
or just a file by itself?
2) Typically, do companies use one giant DAL assembly for all applications
needing a DAL?
3) From what I understand of things, if I wanted to have 3 DAL assemblies
all inheriting a common "base DAL" class, I would have a total of 4
assemblies. Is that correct? 1 base DAL assembly, then 3 more assemblies
for each application?
4) Check out my little inheritance thing below, question will follow:
class DALBase
abstract class DAL_AppCommon : DALBase
class DAL_AppCommonMySql : DAL_AppCommon
class DAL_AppCommonSqlServer : DAL_AppCommon
abstract class DAL_AppInventory : DALBase, DAL_AppCommon
class DAL_AppInventoryMySql : DAL_AppInventory
class DAL_AppInventorySqlServer : DAL_AppInventory
What I'm trying to achieve is to have a concrete instance of say...
DAL_AppInventory and have it inherit the appropriate DAL_AppCommon derived
class. In other words, if I Instantiate DAL_AppInventoryMySql, I would like
it to also have the DAL_AppCommonMySql methods/properties.
I know that I can create a factory for each DAL_App* class and then have a
instance member of DAL_AppCommonMySql in my DAL_AppInventoryMySql, but I
would rather do this with inheritance if possible. I hope that makes sense.
General pointers/tips/clues VERY welcome.
Thank you for reading,
Steve
I'm designing my DAL layer(s) for our suite of applications and I'm
designing myself in circles, it's gotten to the point where each idea just
mixes me up more

We have 3 loosely related applications and I would like to use an assembly
for the DAL in each of them. I have thought of using a single assembly for
all of them with several different classes for providers/application
specific code, thought of a separate assembly for each application, etc.
I have several questions that I'm hoping will lead to some clarity if I can
get them answered and hopefully you can help with some of the answers.
1) Is there a way to share .cs files across several projects? I'm used to
this with C++, but in c# it seems that this results in a copy of the files
into each project. Is there a way to reference a file from another project?
or just a file by itself?
2) Typically, do companies use one giant DAL assembly for all applications
needing a DAL?
3) From what I understand of things, if I wanted to have 3 DAL assemblies
all inheriting a common "base DAL" class, I would have a total of 4
assemblies. Is that correct? 1 base DAL assembly, then 3 more assemblies
for each application?
4) Check out my little inheritance thing below, question will follow:
class DALBase
abstract class DAL_AppCommon : DALBase
class DAL_AppCommonMySql : DAL_AppCommon
class DAL_AppCommonSqlServer : DAL_AppCommon
abstract class DAL_AppInventory : DALBase, DAL_AppCommon
class DAL_AppInventoryMySql : DAL_AppInventory
class DAL_AppInventorySqlServer : DAL_AppInventory
What I'm trying to achieve is to have a concrete instance of say...
DAL_AppInventory and have it inherit the appropriate DAL_AppCommon derived
class. In other words, if I Instantiate DAL_AppInventoryMySql, I would like
it to also have the DAL_AppCommonMySql methods/properties.
I know that I can create a factory for each DAL_App* class and then have a
instance member of DAL_AppCommonMySql in my DAL_AppInventoryMySql, but I
would rather do this with inheritance if possible. I hope that makes sense.
General pointers/tips/clues VERY welcome.
Thank you for reading,
Steve