Re: nunit deploy and accessibility modifiers

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




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

.



Relevant Pages

  • Re: WIN API and PAF Integration
    ... a MUMPS database. ... the software to developers and therefore implement our own API calls etc. ... > client, I rather suspect that it is being hammered right now. ... > accesses the DLL ...
    (alt.comp.lang.borland-delphi)
  • Getting Calling Thread (DLL) Module Name
    ... I have a server DLL that serves other client processes. ... Function wcConnectrecords the process module name for our client monitor. ... I am trying to find a way without creating another API function where I ...
    (microsoft.public.win32.programmer.kernel)
  • Re: API or standard DLL?
    ... What is the difference between an API and standard DLL? ... Based on what you've said above, is is not totally clear if your client ... If you do create a DLL, the language you choose doesn't really matter, ...
    (comp.programming)
  • Re: Getting Calling Thread (DLL) Module Name
    ... >I have a server DLL that serves other client processes. ... > server DLL function ) with is part of our API. ... > I am trying to find a way without creating another API function where I ...
    (microsoft.public.win32.programmer.kernel)
  • Re: patterns for getting system status...
    ... the Strategic Decision Maker (client), the controller does ... In that case it might be necessary to treat the conversion processing as a basic responsibility of the Controller and provide objects to do it within the main subsystem implementation. ... The trick is replace functionality the way one wants it to be and then insert a proper interface into the legacy code to isolate that functionality. ...
    (comp.software.patterns)