1

I created a multi-layer project, structured like this

  • UI
  • Application
  • Domain
  • Infrastructure

I have an Entity in the Domain-Layer called 'Domain'. It represents an internet domain, as the project is a kind of a "Domain-Management-Software" I struggled finding a better name for that entity...

Now what I've got is a "type name expected but namespace found"-Error in Visual Studio. The best way I've found so far, to get rid of the error, is to prefix the Entity with its namespace. So creating a new instance looks like this:

var domain = new Domain.Entities.Domain();

Is this the way to go, or do you know a more elegant solution?

3
  • Why not InternetDomain as the entity name ?
    – Shyju
    Jul 30, 2012 at 21:35
  • I would also avoid having a top level namespace of "Domain" opting instead for a product name.
    – eulerfx
    Jul 30, 2012 at 23:52
  • Sorry if it was unclear. The product name was omitted in my question.
    – Sandro
    Jul 31, 2012 at 7:54

1 Answer 1

4

You'll avoid a lot of confusion down the road if you change either one of those terms. If you're writing code for human beings to read as well as for machines to read, you should be concerned about the ambiguity that giving the same name to 2 related parts of your system would induce.

I'd call the Entity InternetDomain or (better yet, and) call the namespace DomainModel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.