1

Topic: Usage of interfaces for business objects

If in your project business objects in contracts are defined in the form of classes, by transmission from one layer in other Author: Shmj Date: 26.09 15:44 double conversion. At first you transform objects of layer A to objects of a general view (which are defined in contracts), then from objects of a general view transform to objects of a layer B. And if you  interfaces without specific implementations - that is one conversion as the object of any layer is transformed to one side to the interface automatically. In world Java such circuit is more spread. And here in.Net interfaces create only for services and business objects are fulfilled in the form of classes. Even in the same Guidelines there is a recommendation: DO NOT use weakly typed collections in public APIs. + The type of all return values and parameters representing collection items should be the exact item type, not any of its base types (this applies only to public members of the collection). 1 I.e. For collections recommend to return specific type, instead of basic or the interface. Why? In what a minus? After all one horse-radish between layers happens copying.

2

Re: Usage of interfaces for business objects

Hello, Shmj, you wrote: S> Even in the same Guidelines there is a recommendation: S> S> DO NOT use weakly typed collections in public APIs. + S> The type of all return values and parameters representing collection items should be the exact item type, not any of its base types (this applies only to public members of the collection). 1 This recommendation about ArrayList, Hashtable, etc. collections. The recommendation urges to use .

3

Re: Usage of interfaces for business objects

Hello, hardcase, you wrote: S>> S>> DO NOT use weakly typed collections in public APIs. + S>> The type of all return values and parameters representing collection items should be the exact item type, not any of its base types (this applies only to public members of the collection). 1 H> This recommendation about ArrayList, Hashtable, etc. collections. The recommendation urges to use . "... Should specify member type, instead of one of its base types. Like speech about itself <T>.

4

Re: Usage of interfaces for business objects

Hello, Shmj, you wrote: S> "... Should specify member type, instead of one of its base types. Like speech about itself <T>. It that people did not fence similarity ConfigurationElementCollection.