Better Design RRS feed

  • Question

  • Hi ,

    i am looking for better design approach for below use case.

    Use Case :

    I am developing Silverlight application and In my main page i am dynamically placing the usercontrols based on some conditions.And i am planing to use the reflection to add these user controls to my main page.But to display data all these user controls required some set of params.so i am planing to create single class with all properties and need to share among these user controls.and i will update this business object while loading the Mainpage page and need to use reflection to instantiate usercontrol object and placed into this.

    Any better approach on this above use case? Any example?





    Thursday, June 16, 2011 1:22 PM

All replies

  • Hi,

    Ok start with a disclaimer. What your about to read might not be a better approach; it's an alternative approach based on some assumptions drawn from projects that did similar things to what your looking to do.

    Right that is that out the way.

    The idea of creating a single class that describes how the screen is configured would be how I would do it but I don't see any advantage to using reflection. I'd imagine that reflection would only be used if the properties of the class weren't known, but they should be known.

    The strategy pattern might help here but it depends on your project.

    Could you give some more information on the project and the single class. Like for example what properties are there and what parts of the UI wauld be created when they are set to certain values? Be a bit more specific, a bit more higher level, about what is shown what is not in the UI when what properties are set.

    "The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination." - Fred Brooks
    Friday, June 17, 2011 8:02 AM
  • There are few questions

    1. Is there any possibility of extensibility i.e. would there be change in nos of user controls and advanced version of such user controls in the future?

    2. When you sharing data among user controls, so user controls have access to this data or it would be contained in user control?Please provide details.

    If the answer for first question is YES, the fitting choice would be MEF (Microsoft Extensibility Framework)  also this would solve question reagrding refelection.

    For further reading on this subject, please refer to following URL


    Hope this helps.

    Please mark this as "Answer" or "Vote as helpful" if it has resolved your issue/question/problem.
    • Proposed as answer by Vishvvas Tuesday, June 21, 2011 12:36 PM
    Friday, June 17, 2011 11:22 AM
  • Do check the feasibility with silver light technology whether your use case functional requirement can be met with use of silver light technology.
    As mentioned above , checking the feasibility study with respect to use case is very important , and the software technology selection is important with reference to
    software projects or use case.
    It is very serious matter.  Do understand what you are looking for in the first place.
    Remember effort cost money .
    Any software technological issues contact microsoft direclty.
    Trust and Credibility are the important factors in the relationship between customer and software provider.

    Monday, June 20, 2011 10:40 AM