Re: Feedback on DDD architecture in application
Chris, from a DDD point-of-view, I believe it is correct for the
repository to live in the domain.
Krister, for a larger (business application) project, I would be wary
about the domain objects being returned to the client via your web
service. Over time you would undoubtadely have to compromise your
domain model to deal with serialization, and client concerns. I wonder
if it would be better to map the domain objects to DTOs (service data
contracts). Probably overkill for a project this size, but I would
expect a fine-grained domain model and coarse-grained services.
DTOs are generally to be avoided, but if you are using WCF services,
there is an implication that your middle-tier is hosted in a different
process (and across the wire) from your Silverlight client. When
designing services, I believe you should be taking a contract-first
approach which may not align with the design you want for your domain.
--- In domaindrivendesign <at> yahoogroups.com, "Chris Martin" <chris@...>
wrote:
>
> I'm just going to ramble on....;)
>
> It's a decent example, in that it works, IMO.
>
> There are a few things I didn't really like. And I think they are mostly
> gripes outside of DDD.
>
> The biggest one is that your repositories are concrete and live in the
> domain.
>
> At this point in your project, I would delete the GameRepository as it's
> sole purpose in life is to call GameFactory.Create. What's the point of
> that?
>
> I'm also not a big fan of hiding classes in files that are named
differently
> (Constants houses an enum and not constants).
>
> Why are you sticking the service in the UI layer? That one really
throws me.
>
> Your GameResultRepository is severely tied to the file system. And
it's *hard
> coded* to your machine to boot! Abstract those repositories out and
create
> your concretes elsewhere.
>
> I can't load the Silverlight project as I don't have the required bits
> installed....
>
> I hope I was of, at least, a bit of help. ;)
>
> Cheers,
> Chris
>
> On Tue, Aug 19, 2008 at 10:09 AM, Krister <lukask77@...> wrote:
>
> > In some days I have created my first simple Silverlight application.
> > Other technics I have used is Linq, WCF, DDD and TDD. I would
> > appreciate some feedback on the DDD part of the application.
> > You can download the source code from this address:
> > http://dev.levasunt.nu/MyMemory.zip
> >
> > The code is coded in C# Visual Studio 2008.
> >
> > The game you can find on this address: http://dev.levasunt.nu
> >
> > Regards
> > Krister
> >
> >
> >
>
------------------------------------