Connecting Tech Pros Worldwide Forums | Help | Site Map

The simple stuff

Rowan
Guest
 
Posts: n/a
#1: Jul 2 '07
Hi there,

I am planning/building an n-Tier system with 2 presentation layers
(web, windows) which will share the BLL and DAL. This is my first
experience with .Net. As a VB6er I had to work hard to gain an object
oriented perspective. I am sure that will get stronger as I
progress. I've spent quite a bit of time studying the framework. But
now I find I am struggling with the simple things. I am in a small
company and therefore have no one's experience to learn the easy stuff
from. I've read many articles and postings trying to glean this but
find myself still unsure.

I started building the DAL. It references a class library containing
constants Mycompanyname.Common I think I referenced by putting
"Imports Mycompanyname.Common" in the DAL namespace but I don't
actually know what else to do here. I have so many questions here I
don't even know quite where to start or how to slim it down to the
nitty gritty. I guess to start...where do I put the
Mycompanyname.Common.dll? I know there is more than one place to put
it depending upon whether it is a private assembly or not. Both my
DAL assembly and BLL assembly will reference the Mycompanyname.Common
assembly. Would that mean it should not be private? Do I need to put
the .Common dll somewhere first and then add it to the DAL Reference
folder?

How do I handle the BLL/DAL dll? The way I see it the BLL references
both the DAL and the .Common. The DAL references the .Common. The
presentation layers reference the BLL. Does that mean that I put the
BLL dll in GAC since it will be referenced by both presentation
layers? I think there is probably an SNL skit here somewhere.

I would truly appreciate any help or guidance here. I am sure many of
you have a standard process that you step through at each point of
development. I would like to follow a strong example so I can be the
same for the other VB6er in my company and to be as good as I can be
at this.


Juan T. Llibre
Guest
 
Posts: n/a
#2: Jul 2 '07

re: The simple stuff


re:
!I guess to start...where do I put the Mycompanyname.Common.dll?

If you only are going to use it in one application, in the application's /bin directory.
If you're goping to use it on more than one application, in the GAC.

re:
!Both my DAL assembly and BLL assembly will reference the Mycompanyname.Common
! assembly. Would that mean it should not be private? Do I need to put the .Common dll
!somewhere first and then add it to the DAL Reference folder?

See above. You can use either location.
The /bin directory makes it easier to update the assembly if there's changes to it, though.

re:
!Does that mean that I put the BLL dll in GAC since it will be referenced by both presentation layers?

Again, it doesn't matter.
You should have no problems with either location.

That's one of the great advantages to having true OOD, which VB6 had only an inkling about.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
======================================
"Rowan" <phantomtoe@yahoo.comwrote in message news:1183404358.973814.93600@o11g2000prd.googlegro ups.com...
Quote:
Hi there,
>
I am planning/building an n-Tier system with 2 presentation layers
(web, windows) which will share the BLL and DAL. This is my first
experience with .Net. As a VB6er I had to work hard to gain an object
oriented perspective. I am sure that will get stronger as I
progress. I've spent quite a bit of time studying the framework. But
now I find I am struggling with the simple things. I am in a small
company and therefore have no one's experience to learn the easy stuff
from. I've read many articles and postings trying to glean this but
find myself still unsure.
>
I started building the DAL. It references a class library containing
constants Mycompanyname.Common I think I referenced by putting
"Imports Mycompanyname.Common" in the DAL namespace but I don't
actually know what else to do here. I have so many questions here I
don't even know quite where to start or how to slim it down to the
nitty gritty. I guess to start...where do I put the
Mycompanyname.Common.dll? I know there is more than one place to put
it depending upon whether it is a private assembly or not. Both my
DAL assembly and BLL assembly will reference the Mycompanyname.Common
assembly. Would that mean it should not be private? Do I need to put
the .Common dll somewhere first and then add it to the DAL Reference
folder?
Quote:
How do I handle the BLL/DAL dll? The way I see it the BLL references
both the DAL and the .Common. The DAL references the .Common. The
presentation layers reference the BLL. Does that mean that I put the
BLL dll in GAC since it will be referenced by both presentation
layers? I think there is probably an SNL skit here somewhere.
>
I would truly appreciate any help or guidance here. I am sure many of
you have a standard process that you step through at each point of
development. I would like to follow a strong example so I can be the
same for the other VB6er in my company and to be as good as I can be
at this.
>

=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
 
Posts: n/a
#3: Jul 2 '07

re: The simple stuff


It sounds to me like you are biting off more than you are really prepared to
chew here. I'd recommend searching for, downloading, and reviewing OPC (other
people's code) for starters and get a good perspective on how they are doing
this N-Tier "stuff". After spelunking some pretty good code, you'll have a
much better perspective on how you think you should go about yours.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com



"Rowan" wrote:
Quote:
Hi there,
>
I am planning/building an n-Tier system with 2 presentation layers
(web, windows) which will share the BLL and DAL. This is my first
experience with .Net. As a VB6er I had to work hard to gain an object
oriented perspective. I am sure that will get stronger as I
progress. I've spent quite a bit of time studying the framework. But
now I find I am struggling with the simple things. I am in a small
company and therefore have no one's experience to learn the easy stuff
from. I've read many articles and postings trying to glean this but
find myself still unsure.
>
I started building the DAL. It references a class library containing
constants Mycompanyname.Common I think I referenced by putting
"Imports Mycompanyname.Common" in the DAL namespace but I don't
actually know what else to do here. I have so many questions here I
don't even know quite where to start or how to slim it down to the
nitty gritty. I guess to start...where do I put the
Mycompanyname.Common.dll? I know there is more than one place to put
it depending upon whether it is a private assembly or not. Both my
DAL assembly and BLL assembly will reference the Mycompanyname.Common
assembly. Would that mean it should not be private? Do I need to put
the .Common dll somewhere first and then add it to the DAL Reference
folder?
>
How do I handle the BLL/DAL dll? The way I see it the BLL references
both the DAL and the .Common. The DAL references the .Common. The
presentation layers reference the BLL. Does that mean that I put the
BLL dll in GAC since it will be referenced by both presentation
layers? I think there is probably an SNL skit here somewhere.
>
I would truly appreciate any help or guidance here. I am sure many of
you have a standard process that you step through at each point of
development. I would like to follow a strong example so I can be the
same for the other VB6er in my company and to be as good as I can be
at this.
>
>
Rowan
Guest
 
Posts: n/a
#4: Jul 2 '07

re: The simple stuff


On Jul 2, 1:02 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
Quote:
It sounds to me like you are biting off more than you are really prepared to
chew here. I'd recommend searching for, downloading, and reviewing OPC (other
people's code) for starters and get a good perspective on how they are doing
this N-Tier "stuff". After spelunking some pretty good code, you'll have a
much better perspective on how you think you should go about yours.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com
Forgive me if I seem testy but I don't understand why you put the
effort into typing your response. I have searched for, downloaded,
and reviewed MANY OPC. I understand exactly what the architecture is
supposed to be and why. When it comes to coding I cast about for best
practice and who seems to have the cleanest and most efficient code to
learn from because I want whatever I do to be solid, consistent, and
clear. I have spent hours and hours and hours working on absorbing
the .Net Framework. It is a lot of information to synthesize. If I
post it is because I am looking for some clarification, help, advice,
or possibly affirmation so I don't go about wasting too much time down
the rabbit hole. Sometimes it only takes an experienced person one
paragraph of explanation to put it all together. I was not expecting
but hoping for that. Whether I bit off more than I can chew is
moot...I can either find a way to chew it or spit it out. I would
prefer to keep my job.

Otavio Decio
Guest
 
Posts: n/a
#5: Jul 3 '07

re: The simple stuff


Rowan,

As your subject line calls for, here some simple stuff I learned over the
years:

The DAL: gotta have one, as you probably noticed. If you want to preserve
your sanity, make the Data Access Objects unaware of where they come from or
where they go to. Some people make (IMHO) the mistake of polluting the DAO's
with SQL - CRUDs, stored procedures. Your DAO model should at a minimum
reflect what is in your database and help your presentation layers to do
some sanity check before bugging the database.

Here's the fun part: the DAL actually is a factory that produces Data Access
Objects as well as consume them to update, insert or delete. You either
build the DAL with SP's (argh), straight SQL (hmm little better) or
reflection (my preferred method). Again, the DAL produces and consumes
objects from the DAO model.

Now look at your BLL: it is free to perform its business functions using the
objects but not caring about the mechanics of retrieving or storing. Since
the DAOs are pure, they can be easily serialized and bound to your
presentation. Which means your presentation knows about the DAL and the BLL
(and the DAO model).

Now, in regards to Common... think a little harder about this - do you
really need that? What are those constants for? Can you put them in a config
file? Or in a resources file? Having a Common class increases coupling and
reduces cohesion.

<flame alert>Whatever you do, stay away from the Microsoft Enterprise
Framework </flame alert>

Otavio


"Rowan" <phantomtoe@yahoo.comwrote in message
news:1183404358.973814.93600@o11g2000prd.googlegro ups.com...
Quote:
Hi there,
>
I am planning/building an n-Tier system with 2 presentation layers
(web, windows) which will share the BLL and DAL. This is my first
experience with .Net. As a VB6er I had to work hard to gain an object
oriented perspective. I am sure that will get stronger as I
progress. I've spent quite a bit of time studying the framework. But
now I find I am struggling with the simple things. I am in a small
company and therefore have no one's experience to learn the easy stuff
from. I've read many articles and postings trying to glean this but
find myself still unsure.
>
I started building the DAL. It references a class library containing
constants Mycompanyname.Common I think I referenced by putting
"Imports Mycompanyname.Common" in the DAL namespace but I don't
actually know what else to do here. I have so many questions here I
don't even know quite where to start or how to slim it down to the
nitty gritty. I guess to start...where do I put the
Mycompanyname.Common.dll? I know there is more than one place to put
it depending upon whether it is a private assembly or not. Both my
DAL assembly and BLL assembly will reference the Mycompanyname.Common
assembly. Would that mean it should not be private? Do I need to put
the .Common dll somewhere first and then add it to the DAL Reference
folder?
>
How do I handle the BLL/DAL dll? The way I see it the BLL references
both the DAL and the .Common. The DAL references the .Common. The
presentation layers reference the BLL. Does that mean that I put the
BLL dll in GAC since it will be referenced by both presentation
layers? I think there is probably an SNL skit here somewhere.
>
I would truly appreciate any help or guidance here. I am sure many of
you have a standard process that you step through at each point of
development. I would like to follow a strong example so I can be the
same for the other VB6er in my company and to be as good as I can be
at this.
>

Rowan
Guest
 
Posts: n/a
#6: Jul 5 '07

re: The simple stuff


Thank you very much. After researching reflection more I see how this
is a better approach for my needs. I like it. I am very glad I
posted. Thank you all for your responses. They help so much.


Closed Thread