none
Project Structure RRS feed

  • Question

  • hi all,

      I have a windows application. My existing application structure is one windows application and module wise windows library for data access logics. Actually all modules pages in the same windows application. So every time when i build i need take the entire windows application which includes all module pages. But some clients only have few modules and others have other few. Here my manager suggests to split the windows application into module wise and main windows application only have common pages like login, about us etc. Actually my menu is loaded based on table entries and the page names are entered in the table. So when i click the menu i load the page using reflection.

      Now i need to restructure the solution so each module have separate windows application and one common windows application. So when i create setup unneeded module reference will remove from the main application and build the setup.  In the existing system, not followed any naming convention for namespace and Assembly name. Each application have separate assembly name. Can anyone help me to organize this in to better way. Because i did all these changes but when i call the page name from the main application it shows no form is found. So can we have common namespace for all projects in the solution or any other better way?

     

    Thursday, April 25, 2013 2:14 PM

All replies

  • I would invest some time in looking at something like MEF and/or PRISM. Whilst that's not a direct answer for you, I think you would get a lot out of it and it would go a long way to resolve those sorts of issues.


    http://pauliom.wordpress.com

    Friday, April 26, 2013 2:55 PM
  • hi,

      I worked by loading from dll. Is this way will impact anything critical?

    Friday, May 3, 2013 12:50 PM
  • MEF works with dll, you deliver your plugins as dll and I agree with Paul, you should be using it to resolve your various dll.

    Prism is xaml orientated and hence WPF but not Windows Forms.  I'm not clear if you're using wpf or not.

    If you're doing WPF then PRISM uses mef and unity so you can resolve where your windows/pages are.  PRISM has imodules which you can swop out or resolve at runtime.  So you can build a window which contain 2 or 3 or 4 imodules of some sort, resolve them from a dll.

    It's very well suited to a situation where you're building a product which comes in pieces the customer pays for separately and or where customers can have different funtionality.

    Your modules would be control library projects and what each is exactly would be resolved at runtime by MEF and Unity. 

    Wednesday, May 8, 2013 10:52 AM
  • thanks friend. Actually i finshed by seperating applications. I created one main windows applications and i load pages from other applications using reflection (lading dll from path). For this i chnage all other applications except main application's output type as dll.
    Friday, May 10, 2013 9:16 AM
  • hi,

       I am facing an issue related to this new structure.

    My application now running fine like Utilitiers project added to all project as reference. All forms related to particular module is maintained in seperate windows application. That is module wise UI application but output as dll. The mian UI application will calls each form using reflection by loading dll of the corresponding module application.

       But now the problem i added a status strip to the MDI form of main UI application. I also added on progress bar in this status bar so that all long running process can update the progress here. But i can't call this progress / background process from other UI because the main application is not added to other applications as reference.

    How can i achive this? Is this good way to add this Main UI application as reference to other applications like Utilities? or any other better method to show the progress commonly

     

    Monday, May 13, 2013 4:40 AM
  • I think it would be worth slowing down and doing a bit of design. Even if you don't use PRISM take a look at how it solves the same problems. In this particular case you'll probably be fine with a shared event or message bus model.

    http://pauliom.wordpress.com

    Saturday, May 18, 2013 2:47 PM
  • I understand some people use Messenger  from MVVM Light in Winforms.

    Never tried it myself but you can pass information around without any references or dependencies between dll.

    Monday, May 20, 2013 12:56 PM