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 2839
>>>>>>>>>>>>>>> >
moving this business logic to the database as stored procedures and >>>>>>>>>>> >>>>
Problem with that approach is our application will have to support ACCESS as
well as SQL Server, in future we might have to deal with Oracle.
We program exclusively on interfaces and not on actual SQL or OLE objects.
By using simple Views we can mask the changes in underlying tables if
needed.
-jay
"bradley" <so*****@micros oft.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.
"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
Make your mind. Horrible language vs not terribly portable.
Eliyahu
"Steve Walker" <st***@otolith. demon.co.uk> wrote in message
news:ys******** ******@otolith. demon.co.uk... In message <#L************ **@TK2MSFTNGP15 .phx.gbl>, Eliyahu Goldin <re************ *@monarchmed.co m> writes"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.
With SQL Server 2005 you can write stored procedures etc. in c#.
Not terribly portable though, is it?
-- Steve Walker
> Data lookups are not business logic.
It can be if the business logic is implemented as meta data tables rather
than hard coded conditional branching and looping.
"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:OX******** ******@TK2MSFTN GP10.phx.gbl: T-SQL is an excellent language for implementing business logic that is tied closely to the database model or database processing. For I dont think you will find many that agree with you. C#, Java, anything is
better at business logic. example, imposing data constraints or referencing a set of parameters
Data level storage constraints are not business logic.
against a lookup table and returning a value. Of course, it helps is
Data lookups are not business logic. -- 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
Look out! The barbarians are at the gate.
"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
"bradley" <so*****@micros oft.com> wrote in
news:#o******** ******@TK2MSFTN GP14.phx.gbl: Data lookups are not business logic.
It can be if the business logic is implemented as meta data tables rather than hard coded conditional branching and looping.
Yes, in that case it could be. In such cases I would put in the middle tier, not the database.
--
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
"Jay Balapa" <jb*****@hotmai l.com> wrote in
news:O$******** ******@TK2MSFTN GP10.phx.gbl: Problem with that approach is our application will have to support ACCESS as well as SQL Server, in future we might have to deal with Oracle.
Then you should do it as my article says.
We program exclusively on interfaces and not on actual SQL or OLE objects. By using simple Views we can mask the changes in underlying tables if needed.
Thats very good, but views wont do complex transforms. And the matter of views vs sps is a SQL
server one, SQL Server is not efficient with views, use SP "as views" when using SQL server.
--
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
Steve, T-SQL is an excellent language for implementing business logic that is tied closely to the database model or database processing. For example, imposing data constraints or referencing a set of parameters against a lookup table and returning a value. Of course, it helps is the developer is at least an intermediate level SQL programmer and familiar with sub-queries, complex joins, conditional grouping and where clauses, etc.
Not better than English, what is called by non native English speakers often
a very poor language when it comes to symantics. Than it is in my opinion
even English with USA slang and therefore even worse.
Just my thought about it.
Cor
Hi Jay, 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.
All this looks pretty good... but...
Outputs are string objects with SQL Statements or just paremeters with dataconnection key.
This is a pretty bad idea. Your presentation objects should pass data
views, data sets, lists of business objects, etc, to the business layer.
The presentation layer must not know anything about the persistence
mechanism. Otherwise, you end up with expensive code to maintain. 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.
This is a structured programming approach. It is not really my style. I
fail to see how you can truly move business logic through a "God Class." (A
God Class is an antipattern. The God Class sees everything, knows
everything, and does everything. :-). This nearly always violates the
Open-Closed principle and produces fragile code (usually in other layers).
Handing off the difficult part to other layers because it is hard to do it
in the business layer is not my first recommendation.
Note that CRUD functionality is not usually the same as a business rule. In
fact, I would suggest that 90% of the real business rules in your app are
not related at all to CRUD functions. These are database operations.
If your system is truly partitioned this way, then your business logic is in
the presentation layer.
3. Data Layer. (SQL Server) I dont use stored procedures. predominantly use Views.
I read your subsequent posts about why you don't use stored procs. I
understand and sympathize. However, typically in code, we have a Data
Access Layer that hides the fact that your underlying system is a particular
database. This data access layer does many of the connection and CRUD
operations.
If you truly want to reconsider how to partition the functionality of your
system, create an idea in your head of the purpose for each layer. Write
that purpose in large letters on a white board, divided into sections for
each layer, and then break our the activities of your system into methods
that you will implement in each layer. Write these methods under the
heading. Make sure that the purpose matches the method. If the method
doesn't support, defend, and make sense in light of the purpose, move it or
redefine it.
Your answer is your own. It is much easier to work with that way, and if it
works for you, use it. Don't let an author decide for you... or a geek on a
newsgroup :-).
In my experience, I have found that CRUD is a feature of the data access
layer. Business objects enforce business rules and nothing else.
Presentation layers deal with presentation and format validation. That
allows me to seperate the functions in a way that is easier to maintain.
Consider reading about the "Layers" pattern in the Buschmann book on
patterns.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
In message <OX************ **@TK2MSFTNGP10 .phx.gbl>, bradley
<so*****@micros oft.com> writes
"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.
T-SQL is an excellent language for implementing business logic that is tied closely to the database model or database processing. For example, imposing data constraints or referencing a set of parameters against a lookup table and returning a value. Of course, it helps is the developer is at least an intermediate level SQL programmer and familiar with sub-queries, complex joins, conditional grouping and where clauses, etc.
Speaking personally, I'm familiar with all of those constructs. The fact
that I can program competently in a language doesn't change my opinion
of whether or not it is horrible. TSQL is horrible. It's BASIC with
support for set-based operations and a slightly uglier procedural
syntax.
I'm not saying it isn't useful. It is immensely so. I'm saying I dislike
it, and were it not an absolute necessity of my professional life, I'd
be happy never to write another line of it.
While I'm being rude about other people's pet languages, by the way, the
same goes for XSLT. And yes, I'm reasonably competent in that too.
--
Steve Walker
In message <Oz************ *@TK2MSFTNGP15. phx.gbl>, Eliyahu Goldin
<re************ *@monarchmed.co m> writes "Steve Walker" <st***@otolith. demon.co.uk> wrote in message news:ys******* *******@otolith .demon.co.uk... In message <#L************ **@TK2MSFTNGP15 .phx.gbl>, Eliyahu Goldin <re************ *@monarchmed.co m> writes >"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.
>With SQL Server 2005 you can write stored procedures etc. in c#.
Not terribly portable though, is it?
Make your mind. Horrible language vs not terribly portable.
Using C# from within the database is not terribly portable between
databases. Implementing a tiered design with simple stored procedures
gives you more options and allows you to do what SQL is good at in SQL
and what object oriented languages are good at in object orientated
languages. If presentation, domain model, data access and database logic
(i.e. stored procedures)are all distinct tiers it's relatively easy to
substitute a different platform for any one of them. If the stored
procedures are relatively simple CRUD affairs, you will even be able to
migrate to a platform which doesn't support stored procedures with
relative ease.
--
Steve Walker This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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?
|
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 ?
|
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:
...
|
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";
}
|
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
| |
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...
|
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
|
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...
|
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.
|
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...
|
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...
| |
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |