|
-
Oct 8th, 2009, 08:50 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Need help in class and win forms
Dear all,
I need helps on the following of my questions. Please help me if u know.
I want to separater my Windows application project into two parts.
(Currently how i code is all my class, module, form will be in one single project)
Now I want to separate them into two projects under one solution.
That is One project will only include pure design which is win forms.
And another project will include DB processing and background business logic.
Can I know how to do that??
Currently only way I can think of is pass the required win form control to the Class Project. But I don't think it is a good way. And at some point, I may need to use all controls on the form to perform a single job. So, I end up passing all controls to the Class Project.
I want to try to google it but don't know which key words I should use to search. My vocab power is not that good in english.
If you know how or have some samples (even a button click or display some text sample) , please kindly share me about this.
The reason I do this is because I want to separate my business logic with design. So, later me or other developer who handle my projects can focus on business logic if something went wrong. I think this can make the projects easier to debug and study.
And also easier to pass to end user if we update or fix the error. In so, we don't need to give the whole set up package to user. we only need to pass them the dll class.
thanks.
scsfdev
-
Oct 8th, 2009, 09:01 PM
#2
Re: Need help in class and win forms
No, the design is completely the other way around. You will create one Windows Forms Application project, which will contain all your presentation logic, and one Class Library project, which will contain the rest. The WinForms project is the application, i.e. the EXE, and it will reference the DLL. That means that your forms will know about your business logic but NOT the other way around. The business logic and data access code has no idea that it's being used by forms, which is the whole point. You're supposed to be able to use that same code in any application, whether WinForms, ASP.NET, WPF, Windows Service or whatever. So, you run the app, the form invokes the appropriate business logic and that simply returns the data, with no specific knowledge of who it's returning it to.
-
Oct 8th, 2009, 09:31 PM
#3
Thread Starter
Addicted Member
Re: Need help in class and win forms
 Originally Posted by jmcilhinney
No, the design is completely the other way around. You will create one Windows Forms Application project, which will contain all your presentation logic, and one Class Library project, which will contain the rest. The WinForms project is the application, i.e. the EXE, and it will reference the DLL. That means that your forms will know about your business logic but NOT the other way around. The business logic and data access code has no idea that it's being used by forms, which is the whole point. You're supposed to be able to use that same code in any application, whether WinForms, ASP.NET, WPF, Windows Service or whatever. So, you run the app, the form invokes the appropriate business logic and that simply returns the data, with no specific knowledge of who it's returning it to.
Hi jmcilhinney,
thanks for your info and reply.
Noted!
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
|