4

I have a database with a gazillion entities, I watched Tim Heuer's video about Silverlight & RIA Services, and he explained how to generate a DomainService.

My question is, should I use many domain services for each entity or merge them all along with all their queries into one big DomainService?

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632

1 Answers1

3

You would typically use a Domain Service for a domain of information (i.e. related entities).

That will usually be either:

  • all/most tables/entities, or
  • groups of closely related tables/entities, or
  • the odd single table/entity

With RIA services it is certainly easier to import them all at once into a single model and have RIA spit out one (very large) domain service file.

Make sure you try out the new RIA Services SP1 (now in Beta) as it now supports complex types and some other new stuff.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
  • I also think it would be easier (and probably cost less performance) to use one single domain. The question is if it doesn't make you go crazy between so many queries, or else surrounding them in regions is good enough (I use the great [VS10x Code Map](http://visualstudiogallery.msdn.microsoft.com/en-us/1c54d1bd-d898-4705-903f-fa4a319b50f2?SRC=Home) extension by [Michael Kiss](http://www.axtools.com/index.php)). – Shimmy Weitzhandler Nov 03 '10 at 11:51
  • 1
    @Shimmy: Very large files seem a bad thing, but you can group them in *#regions* as you suggest (we do) and use the dropdown selector or simple Ctrl-F (find) to locate them :) Cheers. – iCollect.it Ltd Nov 04 '10 at 14:57