473,785 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this a good application Design?

Hello,

Currently my application has three tiers-

1. Presentation Layer (Asp.Net / Win Forms/ Pocket PC UI.)
This predominantly contains User Controls, Custom Controls and Win/Web
Forms.
I have one base form and I inherit from that form.
All validation is done in this tier. There is zero Data Access code in this
tier. This tier exclusively gets DataViews/ Arays/Lists as input. Outputs
are string objects with SQL Statements or just paremeters with
dataconnection key.

2. Business Layer.
Currently this is just a Library residing in the same machine as
Presentation layer. Eventually I plan to use WebServices if application
needs physical seperation.
Most of Business Logic are implemented in this layer. There is absolutely no
UI code here.
These are all bunch of static methods which perform CRUD functionality.
All methods are atomic in nature. I dont rely on Static Variables. There is
just one DatabaseGateway class which does all the functionality.

3. Data Layer. (SQL Server)
I dont use stored procedures. predominantly use Views.
I have been reading up on Rockford Lhotka's business objects and I just feel
that his framework is unnecessarily complex. I just dont see the need to
hold these intermediate Business Objects.

Thanks for your responses.

--
Jay Balapa
Director Of Software Engineering
www.atginc.com

Nov 17 '05
50 2841
"William \(Bill\) Vaughn" <bi**********@b etav.com> wrote in
news:uD******** ******@TK2MSFTN GP15.phx.gbl:
What? I would get your facts straight before advising people to simply
depend on C# for Stored Procedure coding. While it's entirely possible
to write stored procedures and other server-side executables in CLR
languages (including C# and VB.NET), it's not always (and not even
usually) a good idea to do so. CLR code execution should be reserved
for a few specific cases where CPU-intensive operations or those jobs
that TSQL was never designed to handle.


For code that exists on the database server, I agree. Im excited about where MS is going with this, but the
first generation of CLR on the DB I think is going to cause more problems as its not "complete" yet as
to where it will eventually go and be really useful, and in the interim users wont know the proper
roles and will abuse it.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 17 '05 #41
Where did you find in my post any advice for anything? You yourself write
"it's entirely possible to write stored procedures and other server-side
executables in CLR languages (including C# and VB.NET)". That's what I have
said too, nothing more.

Eliyahu

"William (Bill) Vaughn" <bi**********@b etav.com> wrote in message
news:uD******** ******@TK2MSFTN GP15.phx.gbl...
What? I would get your facts straight before advising people to simply
depend on C# for Stored Procedure coding. While it's entirely possible to
write stored procedures and other server-side executables in CLR languages
(including C# and VB.NET), it's not always (and not even usually) a good
idea to do so. CLR code execution should be reserved for a few specific
cases where CPU-intensive operations or those jobs that TSQL was never
designed to handle.
--
_______________ _______________ ______
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
www.sqlreportingservices.net
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights. _______________ _______________ ____
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
With SQL Server 2005 you can write stored procedures etc. in c#.

Eliyahu

"Steve Walker" <st***@otolith. demon.co.uk> wrote in message
news:Iv******** ******@otolith. demon.co.uk...
In message <Xn************ **************@ 127.0.0.1>, Chad Z. Hower aka
Kudzu <cp**@hower.org > writes
>"bradley" <so*****@micros oft.com> wrote in
>news:#9******* *******@TK2MSFT NGP15.phx.gbl:
>> If you want to do away with the complexity of the business objects,
>> then consider moving this business logic to the database as stored
>> procedures and triggers.
>
>There are of course many schools of thought, but personally I would
>never recommend that. If
>you want my views as to why, you can read the link that I just posted.

Agree. For one thing, TSQL is a horrible language to do anything
non-trivial in.

--
Steve Walker



Nov 17 '05 #42
Datasets are not SQL...
So if you need to iterate through dataset objects, that just fine.
But don't pass things like "SELECT * FROM Customers WHERE CustomerId = 1"
from the presentation layer into the business logic. Instead you should do
the following: DataSet customerData = bll.GetCustomer (1); in the presentation
layer

--
Best regards,

WillemM
"Eliyahu Goldin" wrote:
I am not sure what are you getting to by insisting on moving the SQL to the
business layer. It looks to me like insisting on the dotnet framework to
belong to one layer only.

A database consists of tables, view, stored procedures, triggers etc. Tables
and views belong to data layer. Stored procedures and triggers can be in
either data or business layer. It won't hurt the SQL server if it will
contain elements of both levels.

Eliyahu

"Josh" <s@a.com> wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl...
Keeping the layers truely seperate is difficult. I would suggest that

even
if you have to itereate through a result set the SQL should be in the
Business Layer, pass your filter criteria to the business layer.


"Jay Balapa" <jb*****@hotmai l.com> wrote in message
news:eD******** *****@TK2MSFTNG P12.phx.gbl...
Josh,

Thanks for your response.

SQL most of the time is in the Business layer.

Sometimes I need to iterate Datarows in a Datagrid. In those cases I make that exception.

--
Jay
"Josh" <s@a.com> wrote in message
news:OS******** ******@TK2MSFTN GP10.phx.gbl...
> Your SQL should be in the Business Layer. The presentation layer should> not make or provide decisions on how data is collected ( that what tables> / view or columns are used ) as that is a business rule.
>
>
>
> "Jay Balapa" <jb*****@hotmai l.com> wrote in message
> news:%2******** ********@tk2msf tngp13.phx.gbl. ..
>> Hello,
>>
>> Currently my application has three tiers-
>>
>> 1. Presentation Layer (Asp.Net / Win Forms/ Pocket PC UI.)
>> This predominantly contains User Controls, Custom Controls and Win/Web>> Forms.
>> I have one base form and I inherit from that form.
>> All validation is done in this tier. There is zero Data Access code in
>> this tier. This tier exclusively gets DataViews/ Arays/Lists as input.>> Outputs are string objects with SQL Statements or just paremeters with
>> dataconnection key.
>>
>> 2. Business Layer.
>> Currently this is just a Library residing in the same machine as
>> Presentation layer. Eventually I plan to use WebServices if application>> needs physical seperation.
>> Most of Business Logic are implemented in this layer. There is
>> absolutely no UI code here.
>> These are all bunch of static methods which perform CRUD functionality.>> All methods are atomic in nature. I dont rely on Static Variables.
>> There is just one DatabaseGateway class which does all the
>> functionality.
>>
>> 3. Data Layer. (SQL Server)
>> I dont use stored procedures. predominantly use Views.
>>
>>
>> I have been reading up on Rockford Lhotka's business objects and I just>> feel that his framework is unnecessarily complex. I just dont see the
>> need to hold these intermediate Business Objects.
>>
>>
>>
>> Thanks for your responses.
>>
>> --
>> Jay Balapa
>> Director Of Software Engineering
>> www.atginc.com
>>
>>
>>
>>
>>
>
>



Nov 17 '05 #43
I agree with it though, it's not the correct example.

In our case we need to pull the data from different tables, apply business
logic then pull data from other tables if required and insert in to
Temporary table then open cursor on Temporary table which returns data to
calling application.

Regards,
Mahesh

"Michael Rodriguez" wrote:
"Chad Z. Hower aka Kudzu" <cp**@hower.org > wrote in message
news:Xn******** *************** ***@127.0.0.1.. .
"bradley" <so*****@micros oft.com> wrote in
news:#9******** ******@TK2MSFTN GP15.phx.gbl:
If you want to do away with the complexity of the business objects,
then consider moving this business logic to the database as stored
procedures and triggers.


There are of course many schools of thought, but personally I would never
recommend that. If
you want my views as to why, you can read the link that I just posted.


Chad,

I have to respectively disagree with you. There are several instances where
the business logic should be in the stored procedures. Suppose you have a
posting procedure that needs to compute the average cost of items based on
thousands of invoices, then post those costs to another table. In order to
do that logic in the business tier, you would have to retrieve all of the
relevant data locally, crunch it, then send it back to the DB server in
another form. This defeats the whole purpose of having a database server to
begin with. Now you're back to the FoxPro days where the network bandwith
was sucked up by thousands and thousands of rows of data being sent back and
forth across the network for processing. One of the main advantages of
having a database server is to let it crunch (read - perform logic) all the
data and return only the much smaller result set.

I'm not saying your approach is necessarily incorrect. That would work
great if you were dealing with small chunks of data. But when you have to
insert values into tables based on numbers computed from thousands of rows
of data in other tables, I think it's best to let the DB server do all of
the work for you. That way nothing has to travel across a wire.

My $.02

Mike Rodriguez

Nov 17 '05 #44
=?Utf-8?B?TWFoZXNo?= <Ma****@discuss ions.microsoft. com> wrote in
news:90******** *************** ***********@mic rosoft.com:
I agree with it though, it's not the correct example.

In our case we need to pull the data from different tables, apply
business logic then pull data from other tables if required and
insert in to Temporary table then open cursor on Temporary table which
returns data to calling application.


Which is the overwhelmingly common scenario. What I described will work very well for you.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 17 '05 #45
Hi all;
Three tier architecture is very use ful for distributed application; You can
do one thing make some common classes for common functions and use sqlhelper
class as a DAL (Data Access Layer); dont customize sqlhelper class becauase
this can be use for all applications.
you can also customize your shared functions and pass sql statement as
string and can pass perameter according to condition; but you should use
stored procedure;
thankx

"Eliyahu Goldin" wrote:
Sometimes it is the best practice. You can change from one platform to
another without affecting the business logic implemented in stored
procedures.

Eliyahu

"Kim Quigley" <ki********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP14.phx.gb l...
I wasn't aware that putting SQL in the business layer was a best practice.

I
use SQL Server 2000 with stored procedures and my data layer accesses

those
stored procedures. In the business layer, I have logical business objects
with properties and methods. The purpose of having a seperate data layer

is
so that if your data source changes (for example: moving from SQL Server

to
MySQL) then you only have to modify the data layer. The presentation and
business layers would be unaffected.
"Josh" <s@a.com> wrote in message
news:OS******** ******@TK2MSFTN GP10.phx.gbl...
Your SQL should be in the Business Layer. The presentation layer should
not make or provide decisions on how data is collected ( that what tables / view or columns are used ) as that is a business rule.

"Jay Balapa" <jb*****@hotmai l.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> Hello,
>
> Currently my application has three tiers-
>
> 1. Presentation Layer (Asp.Net / Win Forms/ Pocket PC UI.)
> This predominantly contains User Controls, Custom Controls and Win/Web
> Forms.
> I have one base form and I inherit from that form.
> All validation is done in this tier. There is zero Data Access code in
> this tier. This tier exclusively gets DataViews/ Arays/Lists as input.
> Outputs are string objects with SQL Statements or just paremeters with
> dataconnection key.
>
> 2. Business Layer.
> Currently this is just a Library residing in the same machine as
> Presentation layer. Eventually I plan to use WebServices if application
> needs physical seperation.
> Most of Business Logic are implemented in this layer. There is absolutely> no UI code here.
> These are all bunch of static methods which perform CRUD functionality.
> All methods are atomic in nature. I dont rely on Static Variables. There> is just one DatabaseGateway class which does all the functionality.
>
> 3. Data Layer. (SQL Server)
> I dont use stored procedures. predominantly use Views.
>
>
> I have been reading up on Rockford Lhotka's business objects and I just
> feel that his framework is unnecessarily complex. I just dont see the
> need to hold these intermediate Business Objects.
>
>
>
> Thanks for your responses.
>
> --
> Jay Balapa
> Director Of Software Engineering
> www.atginc.com
>
>
>
>
>



Nov 17 '05 #46
I agree. I am don't believe in putting business logic inside of the
database. Business logic belongs in the Business Logic Layer (BLL). In
addition, SQL commands and data access code do not belong in the BLL. A
entity should never know how to persist itself in the database. This is why
I am not a fan of Lhotka's CSLA framework. This breaks classic object
oriented programming rules.

"Chad Z. Hower aka Kudzu" wrote:
"bradley" <so*****@micros oft.com> wrote in
news:#9******** ******@TK2MSFTN GP15.phx.gbl:
If you want to do away with the complexity of the business objects,
then consider moving this business logic to the database as stored
procedures and triggers.


There are of course many schools of thought, but personally I would never recommend that. If
you want my views as to why, you can read the link that I just posted.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu

Nov 17 '05 #47
This has served me pretty well as a base design for
the software families I work on:
--
Robbe Morris - 2004/2005 Microsoft MVP C#
EggHeadCafe's RSS Search Engine
http://www.eggheadcafe.com/articles/...h/default.aspx


"Tony Phillips" <Tony Ph******@discus sions.microsoft .com> wrote in message
news:A0******** *************** ***********@mic rosoft.com...
I agree. I am don't believe in putting business logic inside of the
database. Business logic belongs in the Business Logic Layer (BLL). In
addition, SQL commands and data access code do not belong in the BLL. A
entity should never know how to persist itself in the database. This is
why
I am not a fan of Lhotka's CSLA framework. This breaks classic object
oriented programming rules.

"Chad Z. Hower aka Kudzu" wrote:
"bradley" <so*****@micros oft.com> wrote in
news:#9******** ******@TK2MSFTN GP15.phx.gbl:
> If you want to do away with the complexity of the business objects,
> then consider moving this business logic to the database as stored
> procedures and triggers.


There are of course many schools of thought, but personally I would never
recommend that. If
you want my views as to why, you can read the link that I just posted.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu

Nov 17 '05 #48
http://www.eggheadcafe.com/articles/...plications.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#
EggHeadCafe's RSS Search Engine
http://www.eggheadcafe.com/articles/...h/default.aspx


"Tony Phillips" <Tony Ph******@discus sions.microsoft .com> wrote in message
news:A0******** *************** ***********@mic rosoft.com...
I agree. I am don't believe in putting business logic inside of the
database. Business logic belongs in the Business Logic Layer (BLL). In
addition, SQL commands and data access code do not belong in the BLL. A
entity should never know how to persist itself in the database. This is
why
I am not a fan of Lhotka's CSLA framework. This breaks classic object
oriented programming rules.

"Chad Z. Hower aka Kudzu" wrote:
"bradley" <so*****@micros oft.com> wrote in
news:#9******** ******@TK2MSFTN GP15.phx.gbl:
> If you want to do away with the complexity of the business objects,
> then consider moving this business logic to the database as stored
> procedures and triggers.


There are of course many schools of thought, but personally I would never
recommend that. If
you want my views as to why, you can read the link that I just posted.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu

Nov 17 '05 #49
Pretty good stuff, Robbe!

--

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Robbe Morris [C# MVP]" <in**@eggheadca fe.com> wrote in message
news:Oz******** ******@TK2MSFTN GP09.phx.gbl...
http://www.eggheadcafe.com/articles/...plications.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#
EggHeadCafe's RSS Search Engine
http://www.eggheadcafe.com/articles/...h/default.aspx


"Tony Phillips" <Tony Ph******@discus sions.microsoft .com> wrote in message
news:A0******** *************** ***********@mic rosoft.com...
I agree. I am don't believe in putting business logic inside of the
database. Business logic belongs in the Business Logic Layer (BLL). In
addition, SQL commands and data access code do not belong in the BLL. A
entity should never know how to persist itself in the database. This is
why
I am not a fan of Lhotka's CSLA framework. This breaks classic object
oriented programming rules.

"Chad Z. Hower aka Kudzu" wrote:
"bradley" <so*****@micros oft.com> wrote in
news:#9******** ******@TK2MSFTN GP15.phx.gbl:
> If you want to do away with the complexity of the business objects,
> then consider moving this business logic to the database as stored
> procedures and triggers.

There are of course many schools of thought, but personally I would
never recommend that. If
you want my views as to why, you can read the link that I just posted.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu


Nov 17 '05 #50

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

Similar topics

2
3475
by: ggg | last post by:
I'm looking for a complete project/application done with heavy use of of object-oriented programming & design. Preferably something well documented and/or commented so that I can pick it apart and learn how/why they designed it they way they did. Any suggestions?
3
3802
by: Erik De Keyser | last post by:
Hi group, I have a couple of projects with up to 8 forms. On most projects I write the code on each form with no modules. The last project I use 1 module and minimal code on each form , in fact just the code for each visual object, and all the subroutines are placed in a module. What is the best practice where I can place my VB code, at each form or in a separate module ? Pro's & con's ? Performance benefit ?
55
3482
by: Cindy | last post by:
Hello!! I'm new at access and there's is an article by Arvin Meyer for beginners that is references in Google Groups but I can't seem to find the original post with the article's URL. Does anyone know where I can find that article, or why the thread appears to be missing from the archives? Here's the link: ...
45
2423
by: Brett | last post by:
If I do this without declaring a corresponding field, is it considered bad design? What are the advantages or disadvantages to either method? Notice there is not set. public string URL { get { return "www.somewhere.com/test.aspx"; }
4
1490
by: Bob | last post by:
I know this is a tall order, but I'm looking for a book that talks about the implications of alternative approaches to languages than we typically see, such as allowing multiple inheritance... detailed, but not so heavy that the interesting, qualitative conclusions are left to the reader to dig out of a set of equations. Any recommendations? Bob
4
1706
by: GS | last post by:
Hi, I'd rather start from a good design and go from there so would be greatfull for any input. I have a simple ASP.NET application and would like to make solution elegant. I store settings in web.config file and I would like to have class in my application which will hold application level objects. Some methods of the class will be executed in different threads and some properties are shared among threads and static in nature. So what...
1
1872
by: GS | last post by:
Any points of what would be the good error handling design for application? User error handling in Application_OnError and throw() new errors on conditions through the code? I'd like utlimiately to consolidate all error_handling in one method which I'll be able to easily modify to write to event log or text file etc instead of error hanlding scattered through the code. Thanks, GS
2
1787
by: dotnet dude | last post by:
What boook do you guys recommend for somebody with the software development backgroud who wants to get started from scratch with the designing of good sofware application. I am interested in understanding how the logical and physical design of a software is prepared. Details about the design patterns and the application blocks; and how and when they should be used. I would really appreciate if you guys can recommend some good boook that...
7
1626
by: TAVOSOFT | last post by:
Hi friends, I am begginer , I wanna to learn VB2005 ,Which are good book for to learn VB2005 of level -begginer-intermediate. Thanks you friends.
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
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
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8986
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...
0
6743
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
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4058
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
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.