locked
allow more and more types RRS feed

  • Question

  • User1080785583 posted

    I have a project that needs the ability to scale. If I have 10 object types today, I want to be able to add more later without breaking code. Any methodology build for this to allow us to add a new object into the system and it will simply work with most code?

    Monday, September 23, 2013 2:58 PM

All replies

  • User-760709272 posted

    Depends what it is you have to do with these objects.  If you need to use common properties and methods you can define an interface and have them all use the interface.  If you don't need to call methods/properties but do something common with the objects then you can use generics.

    Monday, September 23, 2013 3:09 PM
  • User1080785583 posted

    I have a generic interface that handles this but I am in the position to allow for expansion of the objects. Would it be safe to say if I have 90% of my units of work in the base class that I am able to expand each object independently as needed? I would like to be able to say, I can create a new type and use its default implementation but I might have to add something different in this new object. 

    Would it be best to use generic interface with default implementation? The catch is that we have an fk_column_type that can be changed and this fk_column_type will be the new object we generate to allow CRUD operations. Thanks in advance.

    Monday, September 23, 2013 4:23 PM