I try to name a class (also members, properties and so forth) as exact as I can. But sometimes I’m not sure if this is so clever if the class name becomes huge (50 chars and mor
Regarding the example of ProjectContractChargingPeriodProjectAccountReferenceVM
, you can refactor it into something like this:
namespace Project
{
public class ContractChargingPeriod implements IAccountReference
{
...
}
public interface IAccountReference
{
...
}
}
The ContractChargingPeriod
is dealing with all the business logic related to contract charging periods. The fact that it implements IAccountReference
also tells that the object refers to an account, but without specifying this in the class name.
You can create simple viewmodels that reflect the contents of these types, but the viewmodels themselves should not contain any business logic. The viewmodels can use the same structure as the example above, but should be defined in a separate namespace.