This is novice question, I am using DI for resolving objects for interfaces at runtime through configuration.
<unity>
<containers>
<container>
<types>
<type
type="BusinessLayer.IBAL, BusinessLayer, Version=1.0.0.0, Culture=neutral"
mapTo="BusinessLayer.BAL, BusinessLayer, Version=1.0.0.0, Culture=neutral" />
<type
type="DataAccessLayer.IDAL, DataAccessLayer"
mapTo="DataAccessLayer.DAL, DataAccessLayer, Version=1.0.0.0, Culture=neutral" />
<type
type="DataAccessLayer.IDbContext, DataAccessLayer, Version=1.0.0.0, Culture=neutral"
mapTo="DataAccessLayer.DbContext, DataAccessLayer, Version=1.0.0.0, Culture=neutral" />
</types>
</container>
</containers>
</unity>
Here in the above configuration is in UI layer web.config.
Does specifying which DAL instance to be created in UI layer web.config is against the Layer separation concepts?
Since all the layers should be independent.....if DAL, BAL dependencies are mentioned in UI layer web.config will it violate the separation principles?
You need to bootstrap your container somewhere. In a web-application that somewhere is usually the main web-project. If you are using an n-tier architecture you are (hopefully) not using your DAL classes directly from your UI but from your BL classes.
Simply referencing your DAL classes in the web.config is not a violation of a layered architecture.
You might want to read this post on the concept of Composition Roots for further explanation.