views:

67

answers:

1

I am wondering what are the best practices for public methods and their return values. Is it ok to return types from referenced assemblies or should I make sure that all the parameters as well as return values are all from within the same assembly?

The reason I ask is that I am in the process of merging assemblies with ILMerge and I would like to internalize all the assemblies except for the main one but that seems to be impossible to do if I have public methods in the main assembly that have parameters or return values for types that are in the internalized assemblies.

To clarify what I am talking about I am referencing Oracle.DataAccess from a CommonUtils project and have DbUtils for creating OracleParameter types which are defined in Oracle.DataAccess which is the assembly I would want to internalize but cant.

Can anyone clarify this for me?

+1  A: 

It's quite common to return 'string' or 'IEnumerable' return values, so I don't think that's what your question is about.

A good solution might be to return objects that implement interfaces defined in the main assembly.

Eric Minkes