visual studio - cant understand the concept of the many projects in one solution in vs2010 -


i seem having difficulty in understanding reason behind need of having many projects inside 1 solution (in case visual studio 2010 c#).

the use comes mind if creating new classes can test them in console application first, add project solution use these classes project want.

kindly guide me correct way, thanks.

there 3 main reasons come mind splitting solution multiple projects: reuse, encapsulation, , project-specific settings.

  1. reuse
    may have utilities project shared between more 1 solution. may have data access , business rules defined in class libraries, shared between multiple ui projects, such having business application has web interface, desktop interface, , web services. need share same logic , data model, wouldn't want replicate in each solution separately.

  2. encapsulation
    reason achieve encapsulation, 1 of main principles of oop. classes may have internal methods , properties (or classes may defined internal), makes them visible other classes in same project. if it's there achieve specific purpose not should accessible all, splitting classes across separate projects can make properties, methods, , classes visible classes, hidden outside scope of project.

  3. project-specific settings
    there project types behave differently 1 another. web project different windows forms app, different wpf app. kind of goes along #1 , trying achieve code reuse; since can't have single project website and windows forms app and wpf app, create each ui own project , put logic possible separate project can shared between of ui projects.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -