473,789 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Design issue( creation of objects)

H
My application consists of three layers, presentaion layer(PL), Business Logic layer(BLL) and Data Access layer(DAL)
my application is a single windows form application
now BLL consits of couple of classes, in one class of BLL, i need to access a function of PL
the function declaration is as..... public void MyFunc()....... which is not a static one
and there r lot of functions which use the above function.. s
in the middle of the application development i cant change the Function into a static one. At this situation i created a object of the PL and used in the BLL class , Can i do like this
Is my approach is a bad one
I heard that only upper layers should use the objects of the lower layers classes..

My PL class is having an object of my BLL class and my BLL class is having an object of the PL class, is this bad design
PL <----------> BL

-----need hel
---------seas

Nov 16 '05 #1
2 1673
"=?Utf-8?B?c2Vhc2g=?=" <an*******@disc ussions.microso ft.com> wrote in
news:EE******** *************** ***********@mic rosoft.com:
Hi
My application consists of three layers, presentaion layer(PL), Business
Logic layer(BLL) and Data Access layer(DAL). my application is a single
windows form application. now BLL consits of couple of classes, in one
class of BLL, i need to access a function of PL, the function
declaration is as..... public void MyFunc()....... which is not a static
one. and there r lot of functions which use the above function..
This is not right, semantically. Never call a method in tier N+1
from tier N if tier N+1 is laying on top of N. So your BL tier shouldn't
call methods from the GUI, as the BL is a black box for the GUI, it
provides a service API to the GUI. Calls are always from the GUI to BL and
from the BL to the DAL, never the other way around. You'll get cyclic
references as well, which is a signal something is wrong.

If you need to use some logic in the GUI and BL tier, place it in
some separate project, UtilityClasses or whatever, code which is not tied
to a single tier. Then use this utility code in both the GUI and the BL
tier.
so in the middle of the application development i cant change the
Function
into a static one. At this situation i created a object of the PL and
used in the BLL class , Can i do like this?
well... you probably can (however with project references it might
be a problem: gui references BL, BL references GUI), but it's not wise, as
it makes the BL tier semantically part of the GUI.
Is my approach is a bad one?
I heard that only upper layers should use the objects of the lower
layers classes...
true.
My PL class is having an object of my BLL class and my BLL class is
having an object of the PL class, is this bad design? PL <---------->
BLL


It's not that great :) I'd opt for the separate utility lib option,
so you can keep the gui and bl tiers separated.

What kind of code is located in the Method you want to call from
the BL? Perhaps it is better you'd place that call in the BL anyway.

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
Nov 16 '05 #2
Hi seash

Just as Frans said, it is not good practice. BL is supposed to service the PL, not the other way round

Though the actual situation is not clear, I believe delegates and events might help you out

Regards
fbhca

Nov 16 '05 #3

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

Similar topics

2
279
by: seash | last post by:
H My application consists of three layers, presentaion layer(PL), Business Logic layer(BLL) and Data Access layer(DAL) my application is a single windows form application now BLL consits of couple of classes, in one class of BLL, i need to access a function of PL the function declaration is as..... public void MyFunc().......which is not a static one and there r lot of functions which use the above function.. s in the middle of the...
2
283
by: seash | last post by:
H My application consists of three layers, presentaion layer(PL), Business Logic layer(BLL) and Data Access layer(DAL) my application is a single windows form application now BLL consits of couple of classes, in one class of BLL, i need to access a function of PL the function declaration is as..... public void MyFunc().......which is not a static one and there r lot of functions which use the above function.. s in the middle of the...
4
1266
by: Elhanan | last post by:
hi.. i'm a database kind of guy, when ever i apprached a new project i always looked at it from tables point of view, how can normlize correcly and them moved to the objects and desgined them accodging to the tables.. i see that usually ppl go the other way, design objects and then desgin the tables..
6
2141
by: JoeC | last post by:
I have a question about designing objects and programming. What is the best way to design objects? Create objects debug them and later if you need some new features just use inhereitance. Often times when I program, I will create objects for a specific purpose for a program and if I need to add to it I just add the code.
0
9663
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
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10195
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
10136
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
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6765
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
5415
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...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
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

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.