Last post Jul 13, 2011 09:34 AM by amitpatel.it
Jul 13, 2011 09:21 AM|hapax_legomenon|LINK
I'm a junior developer without much experience in OOD. I am building a web app project that contains several user controls.
My user controls need to use many of the same methods, such as get a list of VideoItem POCO objects. So it seems like a good idea to put these methods in one place - but where? Should I create a BusinessObjects folder in my project with a CommonMethods class
to contain them? What is the best practice here?
My method that creates a List of VideoItem objects calls other submethods to do its job.
I'm using EF 4.1 Code First and I already have a folder called Data where I put my POCOs.
Jul 13, 2011 09:23 AM|sbrauen|LINK
There is no single place you "should" put your code in your project, you can really do it anywhere. Possible ideas are:
- Create a directory in your web project to store the code.
- Just put the code files in the root directory of your project.
- Add a completely new project to your solution to hold your custom code and then reference that project with your web app.
Jul 13, 2011 09:27 AM|sonichya|LINK
add class in app_code folder and write the common methode inside that class
you can use that in number of pages
Jul 13, 2011 09:34 AM|amitpatel.it|LINK
That is depends on your architecutre if you have created architecture with UI, BA and DA then I suggest add one another project thats call Utilies and add this iteam at there by createting one common class. "CommonClass"
If that item its reateld to data entities then need to put in Bussiness object related project/folder (if that methods contains details about business object)
if that is a general logic like , send emails, insert log in log file reated then need to create one another project with utilities and add method at there by creating static class.
If you required more details then I suggest let us know your current project architecture with your method logic.