Reputation: 2861
In my previous job, they utilized alot of IEquatable<IInterface>
and Dictionary<int, IInterface>
declarations. We did alot of websites, as a result utilized Entity Framework (5+) and the DIF model (Castle) for object resolution.
In my new job, i am in the role of transitioning an application to the present. This current project, is a desktop (WinForms) application and have resolved myself out of using EF & DIF, due to the complexity of integration for them. So trying to utilize the EF design into an updated ADO object/parent relationship.
So i have segmented out my singleton declarations into a Domain project, Collection of singletons into the Repository project, and the interaction with the repositories into a Service Project. With the intent of the GUI (WinForms) accessing the Service Project as its sole interaction with the database.
As i am in the phase of designing the Repository design and interaction, i need to be able to store a Collection of the Repo's Domain object and was unsure if i should setup the Dictionary as Dictionary<int, Object>
or Dictionary<int, IObject>
.
As far as local resource management, which implementation would have an overall better load on system resources? What are the pros and cons to either implementation?
Upvotes: 2
Views: 193
Reputation: 5600
It will not make any difference. End of the day, values in Dictionary
will be objects of certain class and will take up space as much as needed by the object.
You need to consider why exactly do you need to use interfaces here? Is it serving some purpose?
Upvotes: 1