Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This is how my solution looks like right now. And it get's to the point where my Controls need reference to Model. It get's real tough to keep Infrastructure, Constants, Controls and Model separated.

For download size and modularity MAIN and Modules (there is many) will stay separate. But those core libraries seem to be referenced by all modules and MAIN. I don't see a point in keeping them in separate projects. I'm sure all of you had this same issue.

So, I wonder if I should keep trying and keep them separate/loosely coupled (hard to do now without circular references) or it is OK to merge them into one Infrastructure project? My Model has lot's of metadata and this metadate needed in controls and other places. Thats where it get's tight.

enter image description here

share|improve this question
    
Sounds a bit like you have a too high coupling between your controls (assuming that it's visual controls), are you using MVVM cause it doesn't really seem so from your drawing. –  cyberzed Nov 4 '11 at 10:02
    
Yes, it's MVVM. Each module.dll has V, VM and VM uses Model.dll –  katit Nov 4 '11 at 12:56

1 Answer 1

You must keep Controls from referencing Model, looks like you are trying to cut some corners and your classes and structures used by UI controls start to leak in ViewModels, and even further the Model.

Think of DataGridRow, you do not use collection of DataGridRows in ViewModel, you use collection of Domain objects.

Data binding and Converters, are the tools to help you keep things separate, when designing your UI controls try to think abstract, imagine that you do not know with what kind of data they will work, try to think on user experience (behavior) they should provide.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.