|
-
February 5th, 2010, 04:33 AM
#1
Namespace Issue in ASP.Net 3 tier architecture
Hi, i am in the process of creating 3 tier architecture for ASP.net with Microsoft Studio 2005.
My architecture is as below
Presentation Layer
-------------------------------
Form1
Form2
Form3
Business Logic Layer
--------------------------
BLTable1
(NameSpace = MyCompany.MyProject.BL. BLTable1)
BLTable2
(NameSpace = MyCompany.MyProject.BL. BLTable2)
BLTable3
(NameSpace = MyCompany.MyProject.BL. BLTable3)
Data Access Layer
---------------------------
DaTable1
(NameSpace = MyCompany.MyProject.DA. DaTable1)
DaTable2
(NameSpace = MyCompany.MyProject.DA. DaTable2)
DaTable3
(NameSpace = MyCompany.MyProject.DA. DaTable3)
I have 2 question here:
(1).MSDN say that we should not have the namespace where its name is same with class name but it does not explain why.Does anyone know why? The msdn page is http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
(2). Business Logic Layer BLTable1 need to interact with Data Access Layer DaTable1 , so i put the code: imports MyCompany.MyProject.DA. DaTable1 inside BLTable1, so that i can have access to all the public shared method inside DaTable1 in BLTable1 for example : DaTable1.Save()
But problem arise when BLTable1 want to use the public shared method in BLTable2 .
I have put the code imports MyCompany.MyProject.BL. BLTable2 inside BLTable1,but i need to key in the class name twice only can access to the public shared method inside BLTable2 for example :BLTable2.BLTable2.Save.
May i know why?
Does anyone has idea on this?
-
February 5th, 2010, 05:34 AM
#2
Re: Namespace Issue in ASP.Net 3 tier architecture
for Q2,
i have found that as long as they are not in the same level of namespace ( MyCompany.Myproject.BL.XXX ), the problem does not happen in the Business Logic layer nor Data Access Layer.
Does anyone know why?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|