473,414 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Implement business logic layer

Hello,

I would like to know what's the best way to implement a business logic
layer between my user interface and my database.

I would say I'd make a dll-project for the business logic layer and make
classes that represent objects/tables. For example, if I have a table
named 'tblPersons' I would make a class named 'clsPersons' and a class
'clsPerson' that represents one person/record. In class 'clsPersons' I
can make some business logic like 'get all persons living in a certain
city'.

What's the best way to display business logic in a Visual Basic.NET or
ASP.NET user interface? Should I use datasets (so my business logic
layer returns a dataset instead of a class object) or should I use the
class objects? If so, whats the best way to display these class objects?

For example, say I've developed a windows form to display a persons
data. From my business logic dll I've received an object of the type
clsPerson. I can't use databindings on a class object, can I?

Hope some can tell me more about this!

Greetings,
Chris

*** Sent via Developersdex http://www.developersdex.com ***
Jun 19 '07 #1
2 4038
Chris Zopers wrote:
Hello,

I would like to know what's the best way to implement a business logic
layer between my user interface and my database.

I would say I'd make a dll-project for the business logic layer and make
classes that represent objects/tables. For example, if I have a table
named 'tblPersons' I would make a class named 'clsPersons' and a class
'clsPerson' that represents one person/record. In class 'clsPersons' I
can make some business logic like 'get all persons living in a certain
city'.

What's the best way to display business logic in a Visual Basic.NET or
ASP.NET user interface? Should I use datasets (so my business logic
layer returns a dataset instead of a class object) or should I use the
class objects? If so, whats the best way to display these class objects?
I never used datasets and recordsets, not saying there is nothing wrong
with them. I favor the business and data persist objects. Even more so,
I favor the object that contains the business rules and data persist
code in one object, a very powerful solution.
>
For example, say I've developed a windows form to display a persons
data. From my business logic dll I've received an object of the type
clsPerson. I can't use databindings on a class object, can I?
Yes, you can do databindings on a class object. if you know how to do it.
>
Hope some can tell me more about this!
You get the CSLA book and read it, you download the CSLA Framework and
understand the basic class objects that are being used, you download the
project and see how it all works.

Then if you like, you can say I don't need the CSLA Framework, because I
have the basics, what the objects and how they work that are needed in a
solution, and I can do it myself from scratch.

http://www.lhotka.net/Article.aspx?i...b-e0059cc82ee7

You may find some other examples of OOPs programming where the business
and data persist logic is separated, but it's still based on the basic
objects that are being talked about the the CSLA examples.
Jun 19 '07 #2
See
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry
or
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!139.entry

Stop with the Hungarian Notation. (nix on the clsSomeObject prefixed with a
cls)

public class Person
end class

public class PersonCollection
end class
//Should I use datasets (so my business logic
layer returns a dataset instead of a class object) or should I use the
class objects?
//
At the bottom of the 2nd URL above I list this URL:
And a reference to read from start to finish, aka, very informative for a
bird's eye view:
*
http://msdn.microsoft.com/library/de...tml/BOAGag.asp
If you pick "Custom Business Objects", then you should look at CSLA
framework, because Rocky makes it easier for you to take custom business
objects and make them bindable.
(IEditableObject and others I believe is the interface, its not trivial to
implement).

"Chris Zopers" <te***********@12move.nlwrote in message
news:uc*************@TK2MSFTNGP06.phx.gbl...
Hello,

I would like to know what's the best way to implement a business logic
layer between my user interface and my database.

I would say I'd make a dll-project for the business logic layer and make
classes that represent objects/tables. For example, if I have a table
named 'tblPersons' I would make a class named 'clsPersons' and a class
'clsPerson' that represents one person/record. In class 'clsPersons' I
can make some business logic like 'get all persons living in a certain
city'.

What's the best way to display business logic in a Visual Basic.NET or
ASP.NET user interface? Should I use datasets (so my business logic
layer returns a dataset instead of a class object) or should I use the
class objects? If so, whats the best way to display these class objects?

For example, say I've developed a windows form to display a persons
data. From my business logic dll I've received an object of the type
clsPerson. I can't use databindings on a class object, can I?

Hope some can tell me more about this!

Greetings,
Chris

*** Sent via Developersdex http://www.developersdex.com ***

Jun 20 '07 #3

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

Similar topics

11
by: Michael Rodriguez | last post by:
I have a windows form that makes a call to my BLL to get some data. The windows form has a progress bar component that I would like updated as the data retrieval takes place. However, strictly...
0
by: Steve | last post by:
I have created a tableadaptor in VWD called "MemberUsernameTableAdaptor" with a "GetUsername()" method. The method requires the @username parameter and will then try matching it up in the username...
0
by: Andre | last post by:
Hi, I need some advise on creating a general Business Logic Layer for my applications. The approach I use today is to create a class with the same name as the table, create a property for each...
1
by: abc my vclass | last post by:
How to design and build reports which data source from business logic layer ? Is there any documents or tutorials explain the steps to design and build reports if my projects' data source from...
2
by: ss | last post by:
Hi, Can anybody give me a SAMPLE VALIDATION CODE (MOST COMMON ONES) IN BUSINESS LOGIC LAYER & DATA ACCESS LAYER I REPEATE SAMPLE VALIDATON CODE IN BLL & DAL BYE SS
16
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
1
by: Frank | last post by:
I have read and followed Scott Mitchells' tutorial, Creating a 'Business Logic Layer', @ http://www.asp.net/learn/dataaccess/tutorial02cs.aspx?tabid=63, and it occurred to me that he did not...
2
by: Ranginald | last post by:
Hi, I am confused about the business layer vs. the dal layer and I could use some help..... I. If the DAL layer has all the methods to work with the db with a typed data sey (e.g....
9
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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...

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.