What do you call classes that do arbitrary work in your project? [closed]

I work on a lot of projects with different teams. Every project has its own conventions, including what to call arbitrary classes that don’t lend themselves to obvious names.

As a counter-example, it’s usually pretty obvious what you should name your models (UserModel, AlbumModel, etc.). The same goes for repositories, installers, controllers and views.

But inevitably there are classes that aren’t as clear-cut. For example, I’m working on a project right now that has a ForumService that does the following:

  1. Connect to the forum database and start a forum session
  2. Retrieve forum posts and comments
  3. Create posts and comments

At first, the name ForumService made sense. But then I read more about service-oriented programming and realized that many developers may consider a service to be something different entirely (like a web service). So now I’m considering whether I should call it ForumProvider or just Forum.

The team I work with full-time likes to name classes like this “Tasks” (e.g. AuthenticationTasks, UserTasks). We also have a lot of “Helpers” (e.g. ViewHelpers) and “Utilities” (e.g. HtmlUtilities) for smaller classes. Some developers don’t like these ambiguous names just because they’re ambiguous.

What do you normally use and why? Do most people generally prefer to avoid names like “Helpers” and “Utilities”, and is there a good reason?

11

Naming things can be tricky – A good rule of thumb is that if you are having trouble naming a class/function clearly then you should read it as a red-flag that you haven’t thought about the architecture or design enough yet and should probably stop coding until you have.

For naming stick to the name of the object/concept being modelled and exclude the design patterns / non-object names for classes unless there is a specific reason to include them. Some examples are…

  • the class is purely or primarily implementing that pattern like SomethingFactory.
  • a distinction is needed to avoid ambiguity like StringBuilder.
  • the architecture (mvvm/mvc/mvp etc) uses it as a convention like DisplayPostViewModel.

In the case of your class it sounds like you’re best off using something like Forum since that is the concept you’re modelling. You’d then need classes for the various objects it needs Post and Template for example. You may want a ForumFactory to create the forum object and create a Dal object for it.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

What do you call classes that do arbitrary work in your project? [closed]

I work on a lot of projects with different teams. Every project has its own conventions, including what to call arbitrary classes that don’t lend themselves to obvious names.

As a counter-example, it’s usually pretty obvious what you should name your models (UserModel, AlbumModel, etc.). The same goes for repositories, installers, controllers and views.

But inevitably there are classes that aren’t as clear-cut. For example, I’m working on a project right now that has a ForumService that does the following:

  1. Connect to the forum database and start a forum session
  2. Retrieve forum posts and comments
  3. Create posts and comments

At first, the name ForumService made sense. But then I read more about service-oriented programming and realized that many developers may consider a service to be something different entirely (like a web service). So now I’m considering whether I should call it ForumProvider or just Forum.

The team I work with full-time likes to name classes like this “Tasks” (e.g. AuthenticationTasks, UserTasks). We also have a lot of “Helpers” (e.g. ViewHelpers) and “Utilities” (e.g. HtmlUtilities) for smaller classes. Some developers don’t like these ambiguous names just because they’re ambiguous.

What do you normally use and why? Do most people generally prefer to avoid names like “Helpers” and “Utilities”, and is there a good reason?

11

Naming things can be tricky – A good rule of thumb is that if you are having trouble naming a class/function clearly then you should read it as a red-flag that you haven’t thought about the architecture or design enough yet and should probably stop coding until you have.

For naming stick to the name of the object/concept being modelled and exclude the design patterns / non-object names for classes unless there is a specific reason to include them. Some examples are…

  • the class is purely or primarily implementing that pattern like SomethingFactory.
  • a distinction is needed to avoid ambiguity like StringBuilder.
  • the architecture (mvvm/mvc/mvp etc) uses it as a convention like DisplayPostViewModel.

In the case of your class it sounds like you’re best off using something like Forum since that is the concept you’re modelling. You’d then need classes for the various objects it needs Post and Template for example. You may want a ForumFactory to create the forum object and create a Dal object for it.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật