473,659 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Architectural question

Hi there,

I am just starting in .net 2.0 with a background in VB6. I have two
projects to complete. The first being a website and the second is a
client application. For now the majority of the website functionality
will be report access however there will be some insert/update
functionality. In the future the website will perform the same
functions as the client app though the interfaces will need to be
different.

I've constructed the architecture with a Data Access Layer, a Business
Logic Layer, and the Presentation Layer. But as I am thinking about
future use I think it makes sense to put the DAL and BLL in a web
service and then simply create my two projects each as a Presentation
Layer that consume this service. If I do this would I also need
another Data Layer in my website for ad hoc queries that may come up
or for work that is web function specific?

I am uncertain if this truly is the best approach since I have no
experience to base judgement. Is there a better way to do this?
Would a web service slow user processing down at all? Would I put the
two layers in the same web service or should I keep the BLL in the
website and build another for the client app or some other variation?
I have read many articles on this and have stepped through tutorials
but would really like an experienced take on it before I move
forward. Help is greatly appreciated.

Rowan

Jun 7 '07 #1
12 1376
Hello Rowan,

RI've constructed the architecture with a Data Access Layer, a
RBusiness Logic Layer, and the Presentation Layer. But as I am
Rthinking about future use I think it makes sense to put the DAL and
RBLL in a web service and then simply create my two projects each as a
RPresentation Layer that consume this service.

Only put WS *upon* the BLL & DAL layers, it untied your dependecies and your
can change the WS easily

RIf I do this would I also need another Data Layer in my website for ad
hoc queries that
Rmay come up or for work that is web function specific?

Why? Let's expose difference service contracs which will be used different
clients, and keep the logic the same
You WS should play like "facade" class

RI am uncertain if this truly is the best approach since I have no
Rexperience to base judgement. Is there a better way to do this?
RWould a web service slow user processing down at all? Would I put
Rthe two layers in the same web service or should I keep the BLL in the
Rwebsite and build another for the client app or some other variation?

Try to simplyfy as much as possible, without any changes to BLL

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Jun 7 '07 #2
Ysgrifennodd Rowan:
Hi there,
<snip />
>
I've constructed the architecture with a Data Access Layer, a Business
Logic Layer, and the Presentation Layer. But as I am thinking about
future use I think it makes sense to put the DAL and BLL in a web
service and then simply create my two projects each as a Presentation
Layer that consume this service. If I do this would I also need
another Data Layer in my website for ad hoc queries that may come up
or for work that is web function specific?
</snip>

On your general point, I think it's generally accepted these days that
an n-Tier approach is a good idea. At the very least, as you suggest,
it allows you to hook up different UI layers to the same back end code.

I'm not sure, though, why you talk about more than one DAL/BLL. You may
need many objects in your data layer, as indeed you might in your
business logic layer; but this is not the same as saying that you have
more than one data access layer/business logic layer. What objects you
need to create and use will, of course, depend on the application model
you develop during the analysis phase of your project.

As for experience in this sort of thing, we don't have any experience of
implementing business logic and data access layers as web services. We
use .NET remoting, using SAOs over TCP/IP. Our primary motivation for
this was to get anything other than presentation layer processing off
the Web server and onto an application server. This has allowed us to
build quite a secure architecture with the web server isolated from our
Windows domain calling a business layer and data access layer which is
on the domain and can therefore use Windows-based security to access the
data - obviating the need to store database credentials anywhere.

Our presentation layer only ever talks to business layer objects: never
DAL objects. These latter are always accessed from the business logic
layer, thus further isolating the public-facing (which includes
"internal only") Web servers from our business data.

You'll have to consider security if you're going to use Web services, to
make sure that the WS is only ever called from your UI components (and
not from some random Web browser with access to the Web server). This
will be particularly important if you add data manipulation facilities
to your application.

And I imagine I don't have to say anything about the dangers of SQL
injection in reporting applications...

HTH
Peter
Jun 7 '07 #3
Why do you want to introduce Web Services into the mix? Everything
you said up to that point made sense. Cramming ALL your data access
through a web service sounds like a terrible idea unless you have some
overwhelming factor forcing your hand that you haven't told us about.
It can only cause pain and bring your performance to a crawl.

My suspicion is that you've read one too many MSDN articles. I'd
stick with your well designed business and data layers. Having done
that, you're well ahead of most .NET applications in terms of
architecture. I bet you'll do well!
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Jun 7 '07 #4
Your idea to use the same back-end for both apps is a good one. Whether to
use a Web Service or not is the problem. First, there are performance
considerations. A Web Service is definitely slow. If you use a Web Service,
you're basically exposing your web service to the Internet, so security must
be considered as well. While using authentication and HTTPS, this can be
overcome. But, let's back up a bit. If you're using a Web Service to access
a database, which I assume is a database server, why not access it directly,
since you're going over the network anyway, and you can have secure database
server access, with less performance issues. Second, putting your BLL into
the Service is unnecessary. Put it into a class library which can be used by
both applications. That will yield the best performance. Remember that the
UI is the only difference here.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Rowan" <ph********@yah oo.comwrote in message
news:11******** **************@ j4g2000prf.goog legroups.com...
Hi there,

I am just starting in .net 2.0 with a background in VB6. I have two
projects to complete. The first being a website and the second is a
client application. For now the majority of the website functionality
will be report access however there will be some insert/update
functionality. In the future the website will perform the same
functions as the client app though the interfaces will need to be
different.

I've constructed the architecture with a Data Access Layer, a Business
Logic Layer, and the Presentation Layer. But as I am thinking about
future use I think it makes sense to put the DAL and BLL in a web
service and then simply create my two projects each as a Presentation
Layer that consume this service. If I do this would I also need
another Data Layer in my website for ad hoc queries that may come up
or for work that is web function specific?

I am uncertain if this truly is the best approach since I have no
experience to base judgement. Is there a better way to do this?
Would a web service slow user processing down at all? Would I put the
two layers in the same web service or should I keep the BLL in the
website and build another for the client app or some other variation?
I have read many articles on this and have stepped through tutorials
but would really like an experienced take on it before I move
forward. Help is greatly appreciated.

Rowan

Jun 7 '07 #5
I agree, your idea made abosolute sense until the web service was mentioned.
I currently have a web app and a client app doing much of the same work,
(showing data, inserts, updates, etc) and they're using the same DL and BAL
without the use of a web service. In my opinion I would only use a web
service if your exchanging data with an outside source, but for apps being
used internally I see no logic in using a web service for a business layer
or data layer. Just create a Class to use with both.

Just my thought.

"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:Oo******** ******@TK2MSFTN GP02.phx.gbl...
Your idea to use the same back-end for both apps is a good one. Whether to
use a Web Service or not is the problem. First, there are performance
considerations. A Web Service is definitely slow. If you use a Web
Service, you're basically exposing your web service to the Internet, so
security must be considered as well. While using authentication and HTTPS,
this can be overcome. But, let's back up a bit. If you're using a Web
Service to access a database, which I assume is a database server, why not
access it directly, since you're going over the network anyway, and you
can have secure database server access, with less performance issues.
Second, putting your BLL into the Service is unnecessary. Put it into a
class library which can be used by both applications. That will yield the
best performance. Remember that the UI is the only difference here.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Rowan" <ph********@yah oo.comwrote in message
news:11******** **************@ j4g2000prf.goog legroups.com...
>Hi there,

I am just starting in .net 2.0 with a background in VB6. I have two
projects to complete. The first being a website and the second is a
client application. For now the majority of the website functionality
will be report access however there will be some insert/update
functionalit y. In the future the website will perform the same
functions as the client app though the interfaces will need to be
different.

I've constructed the architecture with a Data Access Layer, a Business
Logic Layer, and the Presentation Layer. But as I am thinking about
future use I think it makes sense to put the DAL and BLL in a web
service and then simply create my two projects each as a Presentation
Layer that consume this service. If I do this would I also need
another Data Layer in my website for ad hoc queries that may come up
or for work that is web function specific?

I am uncertain if this truly is the best approach since I have no
experience to base judgement. Is there a better way to do this?
Would a web service slow user processing down at all? Would I put the
two layers in the same web service or should I keep the BLL in the
website and build another for the client app or some other variation?
I have read many articles on this and have stepped through tutorials
but would really like an experienced take on it before I move
forward. Help is greatly appreciated.

Rowan


Jun 7 '07 #6
I admit I have read quite a few MSDN articles. I also read articles
from other sites which raised doubts in my mind about using WS. That
is why I decided to post a question about it. I haven't felt
comfortable moving forward without knowing for certain why I would or
would not use WS. Glad I verified my doubts. Your answers were all
exactly what I was looking for. It does not make sense to use WS for
this scenario. I have one more question though.

This may seem like a silly question but it is the last thing I need to
know before I can comfortably dive in. To create the back-end BLL and
DAL do I build them in a separate project and compile them into a dll
and use the dll in the client app and web app? What is the common
approach?

Jun 7 '07 #7
Thats what I do.

I create a separate project (class library) and create my BL and DAL in
that, compile it into a DLL then add a reference to that DLL in my projects
that will be using.

I also do this from habit. When I create my BL and DAL project, I add that
project to whatever project I'm working on so if I need to make any changes
to the BL/DAL project I have 1 IDE opened up and the DLL autorefreshs as
well.

make sense?
"Rowan" <ph********@yah oo.comwrote in message
news:11******** *************@a 26g2000pre.goog legroups.com...
>I admit I have read quite a few MSDN articles. I also read articles
from other sites which raised doubts in my mind about using WS. That
is why I decided to post a question about it. I haven't felt
comfortable moving forward without knowing for certain why I would or
would not use WS. Glad I verified my doubts. Your answers were all
exactly what I was looking for. It does not make sense to use WS for
this scenario. I have one more question though.

This may seem like a silly question but it is the last thing I need to
know before I can comfortably dive in. To create the back-end BLL and
DAL do I build them in a separate project and compile them into a dll
and use the dll in the client app and web app? What is the common
approach?

Jun 7 '07 #8
Ysgrifennodd Rowan:
This may seem like a silly question but it is the last thing I need to
know before I can comfortably dive in. To create the back-end BLL and
DAL do I build them in a separate project and compile them into a dll
and use the dll in the client app and web app? What is the common
approach?
I'd create two additional projects - one for the DAL and one for the
BLL. It's pretty much a matter of taste, though, I think: but I'd
prefer to see two separate assemblies.

I'd also call the DAL through the BLL, and call the BLL via an
interface; and have the BLL inherit from MarshalByRefObj ect and
implement the interface. This will allow you to use remoting at a later
date, should you want to.

This may, however, be total overkill for what you have in mind.

It's only my 2c, as well. There'll be plenty of ways of doing this that
I'd never thought of; most will be equally valid and some probably
better than anything I might suggest.

HTH
Peter
Jun 7 '07 #9
It makes perfect sense. I appreciate everyone's help. I feel
comfortable with the design and will dive in now.

Jun 7 '07 #10

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

Similar topics

0
1241
by: Andrzej | last post by:
I am looking up for book about XML architectural forms. Or good site. Regards Andrzej
4
1129
by: Mike | last post by:
Hi! I have several methods of different importance that I’d like to call asynchronously from Main(). I am going to span these threads but will have to implement some kind of a mechanism to wait until ALL of them finish. I’ve seen some code on MSDN that simply puts thread to sleep (Thread.Sleep(1000)). While it’s acceptable in some cases, I think sleeping is dirty. 1st and foremost, I do not know how much time a background thread is...
2
1436
by: Alexander Kaplunov | last post by:
I have a web service which accepts some data and stores that data in the database. My question is should this web service talk directly to the data access layer (DAL), which populates the database or should there be an extra layer between web service and the DAL? If there should be an extra layer then what is that layer? Also, if you have any link to sites that cover these type of issues I would appreciate it if you could share them.
2
1262
by: Viet | last post by:
I have an architectural issue that I have been working on for quite awhile now and I would like another person's point of view. This issue involves the conversion of a VB6 app to VB.NET. In this VB6 app, the original programmer used 5 timers to periodically scan a document, process it, and display thumbnail images of the scanned document. These 5 timers implement 5 different subroutines that enable this process. In my conversion of this...
11
1762
by: stax | last post by:
Hi, Assuming having a method that calls another method which also calls other methods and so on having a long winded tree of methods. What do I do in case it turns out everything has to be aborted? The only reasonable way I see here is to use a exception but everybody is telling exceptions should not be used for control flow. I just can't think of another reasonable way to deal with this. Are there any good books that teach how to do great...
2
1584
by: engwar | last post by:
Which starter kit or open source project would you consider well-architected? Or more specifically which has good examples to showing a newbie how to separate presentation/business logic/data layer? The Time Tracker 1.x version does NOT seem to fit the bill as there is data access code in the business logic layer. The data layer contains only the SQLHelper class. The duwamish codebase seems to be put together a little better but it
1
1688
by: Griff | last post by:
Hi I'm not sure of the best way to go about achieving my goal and would appreciate any advice. What I would like to do is to generate a control that can be dropped onto a web page. For example, a control that provided catalogue information. As I envisage this, the control would be given a single argument (the end user identifier) and it would return the required catalogue information as an HTML page "fragment".
1
1236
by: Amaxen1 | last post by:
Hello all, I have a general architecture question. We have a system that essentially does multiple processes/operations against a single table. The objective is to increase performance (i.e. amount of throughput) and to reduce latency. I can sacrifice accuracy/consistency if necessary. Batches of about 100-1000 records at a time hit the table at a time, are read and sent to another app for processing, are retrieved and the results...
2
1234
by: DC | last post by:
Hi, I have designed some data objects that I want to be filled by several providers. Do these objects typically belong into a seperate project (plus each provider is a separate project)? The providers do require a number of XML and XSLT files. I guess these belong into the webproject so the provider dll can access the files?
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7359
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.