Click here to Skip to main content
15,905,616 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating a website in 3 layer architecture.It's almost completed but now i have a requirement to add another functionality in to it.What's the better way to add a function and where should i place it,either I define the function in all the places as per the others functions or is there any other way around to do it?
Posted

As you have already done 3 Tier, I would suggest you to maintain that.

Yes, if you want to add a new function, then define it in every Tier and call Business Layer function from Page, then call Data Access Layer function from Business Layer. It is very simple.

And the function should connect to Database and retrieve the data in Data Access Layer, which will return that to Business Layer. Then you have to manipulate that as per your Business logic and return to the main aspx page.
 
Share this answer
 
What operations do you want to perform.
If you want to add business logic you can put your function code in 2nd Layer.i.e Business Layer.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Dec-13 2:20am    
Not an answer. Posting such things as "Solution" is considered as abuse, which can, in case of really heavy abuse, cause to cancellation of a member account due to members' abuse reports. I would advise to be careful with this.
—SA
Sumit Bhargav 20-Dec-13 2:53am    
i need to fetch records from database
Sergey Alexandrovich Kryukov 20-Dec-13 3:11am    
Who are you asking?

Here is the problem: it looks like you did programming without programming, if you are asking how to create a function and where. Not only the question makes no sense, this is a wrong way of working. My impression is that you are trying to do much more complex things than you really can. If you never added a function to your project before, the question is: how come you are doing this project at all?

The statement "I am creating a website in 3 layer architecture" sounds like a great exaggeration here. :-)

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900