Best way to reference business objects from presentation layer..?

There's probably no clear cut and definite answer to this, it depends on what you are doing A will often be good enough in many cases. For small 'single app' projects there isn't really any reason why you can't just reference the business object library directly from both UI and BL layers. It's certainly the simplest, and sometimes simplicity is best B is probably the "best", You'll be abstracting your actual implementations away so future changes are possible without breaking contracts, and unit testing is easier if you have interfaces.

The other advantage of this is that you won't find it too difficult to switch from B to C in the future if you find it necessary C is probably overkill in most cases. That said, on larger projects you may find it necessary. I've worked on large client-server n-tier applications that have had as many as three independent sets of data objects.

One set used in the DA layer to map and store in the database. A second set in the business logic and network layers for processing and passing over the network, and the third set in the client for binding to the UI. It's worth considering using interfaces for C as well because of the abstraction advantages All in all, without knowing exactly your application domain or scope B is a good starting point.

There's probably no clear cut and definite answer to this, it depends on what you are doing. A will often be good enough in many cases. For small 'single app' projects there isn't really any reason why you can't just reference the business object library directly from both UI and BL layers.It's certainly the simplest, and sometimes simplicity is best.

B is probably the "best", You'll be abstracting your actual implementations away so future changes are possible without breaking contracts, and unit testing is easier if you have interfaces. The other advantage of this is that you won't find it too difficult to switch from B to C in the future if you find it necessary. C is probably overkill in most cases.

That said, on larger projects you may find it necessary. I've worked on large client-server n-tier applications that have had as many as three independent sets of data objects. One set used in the DA layer to map and store in the database.

A second set in the business logic and network layers for processing and passing over the network, and the third set in the client for binding to the UI. It's worth considering using interfaces for C as well because of the abstraction advantages. All in all, without knowing exactly your application domain or scope - B is a good starting point.

It would be a great help. Thanks in Advance :) – Nero May 2 at 13:44.

I've seen all three approaches work well. What can sometimes be good is to start with A, then as the complexity increases move to B, then C. In simple projects the "business objects" can be included in the same project as the presentation and persistence tiers - although it may seem heresy, defining the objects using different namespaces can provide enough separation between the "layers".

You may want to reconsider use of . NET Remoting - WCF is by far a better technology and much easier to use.

1 for the . Net remoting comment (The rest is good too). Remoting has been consider obsolete since 3.0.

See MSDN - msdn.microsoft. Com/en-us/library/kwdt6w2k. Aspx – Simon P Stevens Mar 30 '10 at 19:59.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions