473,507 Members | 8,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating n-tier solution

In a current .Net solution (using VB.Net) has a 3 tier architecture of Web
interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?
Nov 18 '05 #1
7 2135
We simply added a business layer to that approach which carries the business
logic and classes.

Web GUI
Business Layer
Data Access Layer
Database

"Robin" <ro*******@hotmail.com> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web
interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?

Nov 18 '05 #2
Also, from what I understand the 3 Tier approach generalizes the division of
Presentation vs Application vs Data logic.

Can anyone confirm or correct this?

"Robin" <ro*******@hotmail.com> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web
interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?

Nov 18 '05 #3
Create a new Project - Other Projects - Enterprise Template Projects - C# or VB Building Blocks - Then Create a Presentation layer, Business
Rules or Facade and a Data Access layer. Have the Presentation reference the Business, and the Business reference the Data - and make sure
you are super vigilant in putting the right stuff in the right layer. After a while it will become second nature.

Bobby Ryzhy
bobby@ domain below
http://weekendtech.net

On Thu, 15 Jul 2004 17:42:00 +0100, "Robin" <ro*******@hotmail.com> wrote:
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web
interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?


Bobby Ryzhy
bobby @ domain below
http://weekendtech.net
Nov 18 '05 #4
3-tier is a bit misleading. You can have as many tiers as you logically
need. For example, we have a 5-tier model, which has a business layer
between the Interface and Data Access layers, and our presentation layer is
divided into 2 layers as well - one for presentation logic/HTML, and CSS for
presentation layout.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Robin" <ro*******@hotmail.com> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web
interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?

Nov 18 '05 #5
Hi,

Strongly recommend to use any MVC II framework (UIP, Maverick) to not
just separate into layers but also decoupling layers.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #6
Attached you will find a zip file. This is the Teired solutions that I use.

We have several large client of ours using this model and it works great.

There are 4 files using Inhertiance which makes it simpler (for me at least)
to keep maintained.

Base.vb - is a must inherit class that basically contains all the fields in
the database and the types. With a function that set a default value in the
fields.

DataAccess.vb - is a must inherit class which inherits the Base class (to
get all the properties) but it can have it own property usually readonly
and the results of joins. This class allow for the updating, deleting, and
create of a single record in the in the database. This also contain
multiple record results in the form of a strongly type collection to reduce
processing overhead and bytes transmitted. Strongly typed collection can
still be bound to anything accepting a .DataSource. Also contain several
function to manage the cache (creation and expiration) of results and items
from the database

BusinessLogic.vb - Inherits the DataAccess class and contains the Validate
function to validate the updates and creates going into the database.

Collection.vb - Custom Strong Type Collection used in the DataAccess to
return results. Contains two classes ...Item and ...ItemCollection
(generated by CodeSmart)

At first this looks like a lot of code to create each time however I have
taken this style of code and using a templated based generation tool called
CodeSmith I created a custom template so I can generate about 90% all the
code I need in about 15 seconds. But some the advantanages are:

- all the data is cache reducing data hits
- all cache expires at 100 seconds (you can change this)
- all cached in managed force updated data out of cache only if it meets
certain criteria.
- business logic is only written one time.
- Everything is strongly typed allowing you to referece (set/get) fields the
Instance.FieldName
- Strongly type collection are by my testing faster, more flexable, and
smaller than Dataset.
- And with CodeSmith it can be generate very very quickly.

I am sure this answer is over kill for your question, but maybe you will
find something else you like in there too.

BTW. Once you do all the VB files you can just create an Reference to the
dll and then...

If you it a data collection you can reference it directly

Gizmo.DataSource = [Root Name Space].Role.GetAllRole()
Gizmo.DataBind

Or by an instance for create, drop, update.

' For create
Dim oRole as New [Root Name Space].Role()
oRole.Description = ""
oRole.Inactive = False
oRole.Create 'Returns a new unique identifier value if you want it
'For Edit key represent the unique row identifier. BTW, remember validation
of the field is done in the class no need for it here.
Dim oRole as New [Root Name Space].Role(Key)
oRole.Description = "Updated Role Description"
oRole.Update 'Returns true or false on the successful completion of process

'For Delete key represent the unique row identifier
Dim oRole as New [Root Name Space].Role(Key)
oRole.Delete 'Returns true or false on the successful completion of process

'Throws an error if business logic encounters an error
Try
Dim oRole as New [Root Name Space].Role(Key)
oRole.Description = "Updated Role Description"
oRole.Update ' or can be .Create or .Delete
Catch e As Exception
'Handle you error here any way you want.
End Try

'To get data out, single record, say a form, key represent the unique row
identifier
Dim oRole as New [Root Name Space].Role(Key)
txtDescription.Text = oRole.Description
cbxInactive.Check = oRole.Inactive

Somewhat straight forward.
-Wayne




"Robin" <ro*******@hotmail.com> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web
interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?



Nov 18 '05 #7
Using following n-tier, database, DAL, class, business logic and Asp.Net,
how do you return class data/data set to the Asp.Net Layer to display all
the data?

As the class and DAL layers are not visible at the Asp.Net layer.

"Marc Castrechini" <mc@merchantwareh4o3u2s1e.com> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
We simply added a business layer to that approach which carries the business logic and classes.

Web GUI
Business Layer
Data Access Layer
Database

"Robin" <ro*******@hotmail.com> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web interface, Data Access Layer and Database.

How do I implement business logic and class layers into this solution?


Nov 18 '05 #8

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

Similar topics

2
2706
by: rdsteph | last post by:
Python411 is a series of podcasts about Python, aimed at hobbyists and others who are learning Python. Each episode focuses on one aspect of learning Python, or one kind of Python programming, and...
6
6092
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at...
2
2129
by: Pawan | last post by:
Hi Guys, I have this current assignment where I have to develop online forms for local municipal authorities. I have to use adobe acrobat to create online forms from PDFs (which I have never done...
2
3766
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html )....
2
4548
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
0
2118
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
12
3139
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
15
2789
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
7
2824
by: Gladiator | last post by:
Hai all, I have Db2 installed in a partition environment . There are 4 partitons on which i created the instance. can any one tell me if i can create a database on the required partitons .........
9
2963
by: =?Utf-8?B?YmJn?= | last post by:
Hi all, I read somewhere "using kernel stuff in thread is not good.." if ManualResetEvent object is created in thread but not actually used, will it affect performance? Bob
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
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,...
0
7371
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...
1
7023
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...
0
5617
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,...
0
4702
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...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
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 ...
0
410
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...

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.