Re: nunit deploy and accessibility modifiers
- From: "Davis Ford" <davisford@xxxxxxxxx>
- Date: 18 Jun 2006 12:18:28 -0700
Mark Wilden wrote:
"Davis Ford" <davisford@xxxxxxxxx> wrote in message
news:1150607935.271224.175810@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, I have a DLL project that implements the Model/Controller part of
MVC, and the client of the DLL would be the View. The interface the
View consumes is the Controller API, and the Model is marked internal,
b/c the View shouldn't need to get at it, but this means I can no
longer test the Model unless my NUnit tests exist inside the DLL
project.
The tests should not be in the same assembly as the Model, because, as you
note, you don't want to have to deploy NUnit.
However, the tests are a client of the model. Unlike with C++, there's no
way to grant access on a class-by-class basis. Hence, you have only once
choice -- make the Model public.
It would be nice if it were impossible then for the View to access the
Model, but there's no way to do that, so you have to live with it. It's not
a big deal in practice - View isn't like a living, breathing voyeur who's
just dying to peak inside your business objects. :)
///ark
I still don't like the idea of making the Model public, simply b/c it
can make for a more confusing API and set of documentation. In some
cases the method called on the Controller is passed through to the same
method on the Model b/c it has no "controller activity" to do. This
can perhaps be confusing -- it is simpler/cleaner if the View looks at
a simple API containing only those things that are relevant to it.
Regards,
Davis
.
- Follow-Ups:
- Re: nunit deploy and accessibility modifiers
- From: Mark Wilden
- Re: nunit deploy and accessibility modifiers
- References:
- nunit deploy and accessibility modifiers
- From: Davis Ford
- Re: nunit deploy and accessibility modifiers
- From: Mark Wilden
- nunit deploy and accessibility modifiers
- Prev by Date: Re: Why is concept of equals and operator== implemented this way?
- Next by Date: Caching data in C# middle tier component for use in VB COM
- Previous by thread: Re: nunit deploy and accessibility modifiers
- Next by thread: Re: nunit deploy and accessibility modifiers
- Index(es):
Relevant Pages
|