Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:06:09+00:00 2026-05-27T15:06:09+00:00

1) A Namespace Domain\Customer with a Class Model namespace MyDomain\Customer; class Model { }

  • 0

1) A Namespace “Domain\Customer” with a Class “Model”

namespace MyDomain\Customer;
class Model { }
class Repository { }

namespace MyDomain\City;
class Model { }
class Repository { }

2) A Namespace “MyDomain” with a class “CustomerModel” ?

namespace MyDomain;
class CustomerModel { }
class CustomerRepository { }

namespace MyDomain;
class CityModel { }
class CityRepository { }

3) A Namespace “MyDomain\Customer” with a class “CustomerModel” ?

namespace MyDomain\Customer;
class CustomerModel { }
class CustomerRepository { }

namespace MyDomain\City;
class CityModel { }
class CityRepository { }

Or …

Our current environment use a PHP auto-load function that include file this way

$o = new MyDomain\Customer\Model.php

Will load the file

MyDomain\Customer\Model.php

Actually where I work we use example #1 that cause all file to be named Model.php. It’s a bit hard to to know what model is open without looking full path in Eclipse IDE.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:06:10+00:00Added an answer on May 27, 2026 at 3:06 pm

    Class names should express what they represent. A class called Model sounds like if it is a general class for certain models. CustomerModel, in contrast, says that it is the model of a customer. Customer also is not clearly defined when you see it out of the context, but in your particular application, the meaning is clear. So I would suggest to chose CustomerModel.

    If you only have Model and Repository classes, it wouldn’t be good to declare a whole namespace only for those two classes, especially when you would define several two-class namespaces. Maybe separate the models from the repositories?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class in my domain model root that looks like this: namespace
I'm trying to get NHibernate to work. I've got this class: mm.k.Domain.Kampagne (namespace/assembly is
I have this: namespace Demo.Framework.Domain { public class UserEntity { public virtual Guid UserId
I have the class B and its parent class A, both in namespace Domain.
using namespace std; class A { public: A() {} ~A() {} map<int, string*>& getMap()
After namespace , class , struct , enum , for , foreach , while
in the System.Linq namespace, we can now extend our IEnumerable's to have the Any()
In AccountType.cs I have: namespace MooDB.Domain { public enum AccountType {Real, Demo, Fictional}; }
error: could not insert: [NHibernateExperiment.Domain.Customer][SQL: INSERT INTO Customer (FirstName, LastName, Address) VALUES (?, ?,
I am battling with dealing with how best to break a domain model up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.