 |
| ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 9th, 2008, 04:53 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Do we need Business Logic Layer.vb files?
On Microsoft Data Access Tutorials, instead of just creating datasets in App_Code, Business Logic Layer (BLL) classes were created as a proxy for the presentation layer to access the Data Access Layer data.
Is BLL a new, advanced class to program the Web database applications? If we can use datasets directly, why we need the BLL. vb files?
TIA,
Jeffrey
__________________
C. Jeffrey Wang
|
|

January 9th, 2008, 05:30 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Also, by decoupling your business logic from your user interface, you promote reuse of your business logic code for other programs. It may gain you much with simple "one-off" database web apps, but it's a vital piece of application architecture design for larger business apps.
Yet another reason for these "separation of concerns" is to provide the capability to use unit testing frameworks. These frameworks are very difficult if not impossible to use when your business logic lives in web project classes or the pages themselves. By building atomic business logic units you can automate tests against them using a unit testing framework.
-Peter
|
|

January 9th, 2008, 07:23 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I believe you both are right.
First thing first. On P. 4,the Tutorial-02 showed some Methods after creating a BLL. vb file. My question is how to 'add' these methods to the BLL classes. By typing the vb codes? Moving the methods created in Datasets.xsd files to here? How?
Any examples showing how to add the Methods to a BLL class?
Thanks.
Jeffrey
|
|

January 9th, 2008, 10:50 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Hi Imar,
Definitely excited to have stumbled across the QuikDoc you referenced today. Looking forward to playing with it for hours!
I downloaded and ran the C# version, and just noticed one odd behavior. Try this:
1. Run the app.
2. Click the button fields on gvContactPersons in exactly this sequence:
Imar Spaanjaars - Email
Some other Dude - Addresses
Some other Dude - Email
Some other dude has got your e-mail address!
Or try any version of that sequence:
Imar Spaanjaars - Phonenumbers
Some other Dude - Email
Some other Dude - Phonenumbers
Imar Spaanjaars - Addresses
Some other Dude - Email
Some other Dude - Addresses
Some other Dude's info isn't displayed. Imar Spaanjaars info appears instead. When I click the Some other dude ButtonField the second time in any of these sequences, WhateverManager.GetList isn't firing. A round-trip to the database isn't happening, so a new Some other Dude business object isn't getting returned. It looks like the View is still bound to the old Imar Spaanjaars object, or something.
Are you seeing what I'm seeing??
Thanks for putting this together. Have to poke around on your site more often!!
Best,
Bob
|
|

January 10th, 2008, 01:54 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I don't know what code you are referring to exactly, but yes, usually you "add" methods into a class by typing in code, copying and pasting it from somewhere else, use built in code generation tools (the Class Designer / Create Method Stub etc) or use external tools like Code Rush.
I don't know what's relevant / referred to in your situation...
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

January 10th, 2008, 04:55 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Thanks.
As I expect, we need to type in codes, use Class Designer, or other tools to add the methods to a BLL. vb file.
Jeffrey
|
|

January 10th, 2008, 05:10 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Bob,
Thanks for catching that. Seems like a bug to me. The fix is easy though; just DataBind the relevant GridView controls whenever you choose a new option:
Code:
switch (e.CommandName.ToLower())
{
case "addresses":
gvContactPersons.SelectedIndex = Convert.ToInt32(e.CommandArgument);
MultiView1.ActiveViewIndex = 0;
gvAddresses.DataBind();
break;
case "emailaddresses":
gvContactPersons.SelectedIndex = Convert.ToInt32(e.CommandArgument);
MultiView1.ActiveViewIndex = 1;
gvEmailAddresses.DataBind();
break;
case "phonenumbers":
gvContactPersons.SelectedIndex = Convert.ToInt32(e.CommandArgument);
MultiView1.ActiveViewIndex = 2;
gvPhoneNumbers.DataBind();
break;
case "edit":
....
}
Will try to update the article ASAP....
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

January 10th, 2008, 10:13 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Thanks Imar. Works great.
Bob
|
|

January 11th, 2008, 12:58 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Just finished reading Part I and get ready for the Part 2.
While trying to recreate the database in SQL Server 2000, I was not sure which download link is for the T-SQL scripts. quickdoc=?
TIA,
Jeffrey
|
|
 |