473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Architecture of my ASP.NET app

I'd appreciate some help from any architectural gurus out there.I'm creating a web app with 3 tiers,
A presentation layer which is an aspnet application.

A business object layer which is a group of custom classes thatmap to my database entities, items of each type, for example'clientitem' and collection classes that are collections ofitems, for example 'clientcollection'.

A data access layer that uses a component class connected to asql database and uses commands, adapters and datasets to returnmy data to the business object layer.
I've referenced the bol in my aspnet app and get some quiteuseful abstraction from the database using this method, myaspnet app is completely ignorant of any information regardingthe database, field names, anything really.

I've referenced my dal app in my bol app and what I am finding isthat I am now required to tie the business object layer to thedatabase layer, field names etc, I could use field positionnumbers/ordingals but I find this unreliable, confusing andpossibly troublesome, I don't want to tie my bol to my dal, howcan I avoid this? Or am I just dreaming, I realise the rubberhas got to touch the road somewhere, the only thing I can thinkof is referencing back to my bol app from my dal app(this wouldallow me to return native bol app entities) but that sort ofnegates having seperate apps for them in the first place.

Basically I'm returning datasets or results as parameters fromthe dal to the bol, then map them into the bol apps entities,how would you guys achive this with some level ofabstraction....?

regards,
JCC.
User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #1
5 1215
This is a common concern with developing applications.

But do you need any more abstraction, its always woth asking the
question before you start to add more in, more abstraction equals a
more complicated app and more code.

Right with that out of the way there are a number of options available,
I like to use a DAL with a data access layer, the layer would use a
factory pattern so that different data sources are available.

You could also move to a service oriented approach and creat 1 or more
web services that become your data provider, but this would need a
coarse grained approach.

There are some Object Relational Mapping tools out there, some use
runtime reflection and some use configuration files and some create
business entities for you.

In my case I like to have 3 tiers with 2 (or more) layers in the data
tier, one that provides the data access and one that actually maps the
physical database to the objects
---------
http://garethjames.blogspot.com/

Nov 19 '05 #2
Hi JCC,

Excellent question!

Abstraction is a wonderful thing. But I don't think you understand it very
well. For example, you say that you have a "presentation layer which is an
aspnet application." This is simply not true. The application is the sum
total of the entire mess. The presentation layer is a user interface. A user
interface is the set of "stuff" that the user sees and interacts with. It is
composed of HTML entirely (unless you are using client-side executables,
etc). On the server side, it should be composed of ONLY those programming
entities that create the HTML. This includes Controls and their event
handlers. And that's pretty much it. Speaking abstractly, it is the part of
the app that presents information to the user. It is a "universal
translator" that speaks computer at one end, and human at the other. It is
like the car's dashboard and pedals.

The "business layer" is the "engine" of the application. It is composed of
business objects that work with data. It has no idea where the data comes
from. It only knows what it is, and how to manipulate it. It is like the
car's engine. The engine takes input from the driver, such as how hard he is
pushing on the gas pedal, how far he has turned the steering wheel in what
direction, etc, and makes the car do what the driver wants it to.

The data layer is what supplies the data to the business layer. It knows
nothing about the data. It only knows how to get it, and how to put it back.
It is like the gas tank on the car. The engine doesn't know where the fuel
is coming from. It only knows how to use it. The gas tank knows nothing
about making the car move. It only supplies fuel to a consumer (the engine).
And the presentation layer knows nothing about either of the other 2, only
how to send and receive messages to and from the human driving the car.

What I'm getting at is, if you think abstractly about these objects when
designing your app, they will make themselves intuitive to you. IOW, the
time to think about all the "stuff" that makes up the interface, engine, and
data layer is not during the design phase. It's best to think of them in
abstract terms, as things, not as code. You think of them as code when you
have to write it. So, when you plan your app, you should probably start with
the data layer, and work your way up to the interface. When you think of
each layer, think of what it should do, not how it should do it. Start from
the mil-high viewpoint, thinking in broad terms, and work your way down to
the details, which should become clearer as you move downward.

What should a data layer do? It should fetch data, store data, change data,
and delete data. How it does this is beyond the scope of what we're
discussing right now. We don't want to think about the details yet. What we
should keep in mind is that, when developing it, we should be on the lookout
for anything that doesn't fall into ne of the above categories, and find its
real home.

What should the business layer do? It should get data from somewhere, know
what the data is, and how to munge it, manipulate it, etc., and be able to
provide the data to an interface of some sort. it should also be able to
talk to the data layer and send it data that needs to be stored or updated,
as well as telling it to delete data. When we develop the business layer we
should be on the lookout for things which should NOT be in there, such as
talking to a database, or using any kind of interface Control.

What should the presentation layer do? It should be able to get data from
somewhere, make it look palatable to a human, and be able to send messages
from the user to the business layer, and from the business layer to the
user. It should never attempt to munge or manipulate data.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.

"Guest" <Guest@aew_nospam.com> wrote in message
news:uX**************@TK2MSFTNGP15.phx.gbl...
I'd appreciate some help from any architectural gurus out there. I'm
creating a web app with 3 tiers,
A presentation layer which is an aspnet application.

A business object layer which is a group of custom classes that map to my
database entities, items of each type, for example 'clientitem' and
collection classes that are collections of items, for example
'clientcollection'.

A data access layer that uses a component class connected to a sql database
and uses commands, adapters and datasets to return my data to the business
object layer.
I've referenced the bol in my aspnet app and get some quite useful
abstraction from the database using this method, my aspnet app is completely
ignorant of any information regarding the database, field names, anything
really.

I've referenced my dal app in my bol app and what I am finding is that I am
now required to tie the business object layer to the database layer, field
names etc, I could use field position numbers/ordingals but I find this
unreliable, confusing and possibly troublesome, I don't want to tie my bol
to my dal, how can I avoid this? Or am I just dreaming, I realise the rubber
has got to touch the road somewhere, the only thing I can think of is
referencing back to my bol app from my dal app(this would allow me to return
native bol app entities) but that sort of negates having seperate apps for
them in the first place.

Basically I'm returning datasets or results as parameters from the dal to
the bol, then map them into the bol apps entities, how would you guys achive
this with some level of abstraction....?

regards,
JCC.
User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #3
J
Thank you gareth and Kevin for your replies.

It's just so easy to produce bloatware rubbish, I don't want to do that, I
want to produce good quality work that I can point at and say 'hey, I did
that.....', even if only for and to myself..... You've certainly given me
something to think about.....

gareth, I think after reading your post I am going to rethink my dal, I just
haven't given it enough thought, I'm going to create one using the idb
interfaces and put a lot more effort, thought and time into it.....

Kevin, thanks for the breakdown of an app architecture in such simple to
understand terms, I'll try to take onboard what you have said. Back to my
Steve McConnell book I think.....

thanks again for your input,
JCC
Nov 19 '05 #4
Hi JCC,

You're very welcome, and with an attitude like that, you'll go far!

--

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.

"J" <jo*************@ntlworld.com> wrote in message
news:nb*******************@newsfe6-gui.ntli.net...
Thank you gareth and Kevin for your replies.

It's just so easy to produce bloatware rubbish, I don't want to do that, I
want to produce good quality work that I can point at and say 'hey, I did
that.....', even if only for and to myself..... You've certainly given me
something to think about.....

gareth, I think after reading your post I am going to rethink my dal, I
just haven't given it enough thought, I'm going to create one using the
idb interfaces and put a lot more effort, thought and time into it.....

Kevin, thanks for the breakdown of an app architecture in such simple to
understand terms, I'll try to take onboard what you have said. Back to my
Steve McConnell book I think.....

thanks again for your input,
JCC

Nov 19 '05 #5
Good luck, sounds like you'll go far

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases...
0
by: Vin | last post by:
Hi, I've got a VB.Net + ASP.Net message board application which has already been customized. There are two solutions in this application. 1. The front end aspx, aspx.vb files, User controls...
4
by: apngss | last post by:
what's the differences between collocated architecture and distributed architecture?? My understanding is that collocated architecture has everything in a single machine? i.e. There is only 1...
2
by: hans | last post by:
Hi! I am new to .NET (coming from Java). We have to implement a desktop application which extracts data from a database, does some analysis, filtering etc. and displays the results. I have...
6
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that...
3
by: RAJESH | last post by:
I am working with c# and asp.net in developing web applications, iam using ..netframework 1.1 ,i want to know what is the need of 3-tier or 4-tier architecture in our application development.what...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
6
by: carsonbj | last post by:
I have an issue where the below operation works on a little-endian architecture but not on a big-endian architecture. I was under the impression that pointer arithmetic is architecture independant...
13
by: rrs.matrix | last post by:
hi i have to detect the type of CPU. whether it is 32-bit or 64-bit.. how can this be done.. can anyone please help me.. thanks.
0
by: srikar | last post by:
Hi all, I am having a problem, when I am compiling the code in 32 bit option on a 64 bit machine using the macro CPPFLAGS= -m32 I am getting the following warnings from the linker . ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.