Good principles to explain the use of data objects

I’m in a little need of names clarification. First a brief description of my position. I prepare as debutant giving a junior developer job descriptions, which also provided another perspective on how important communication is, and to put it beyond doubt.

Simply; I like to understand what he mean with “Context” and I like to give a adopted description of what a POCO is. Now, this is not the exactly problematic words. We haven’t even spoken yet. I describe it more as the semantic problem and focus on data and IoC, because there is the place we’re going to met (He = GUI, I’m BL).

I give a manual-typed sample just as a reference for naming different part of it. Some terms are local to a Manufacturer or tool and some are used more Generic, which I prefer the latter.

// Poco, Model?
public class Customer
{
    public int CustomerId { get; set; }
    public string Name { get; set; }
}


// A short sign of repository pattern
public class CustomerContext
{

   // Is this a context or even a entity? 
   List<Customer> cust;
   public CustomerContext()
   {
      cust = new List<Customer>();
      cust.Add(new Customer() { CustomerId = 1, Name = "Doe" });
      cust.Add(new Customer() { CustomerId = 2, Name = "John" });
      cust.Add(new Customer() { CustomerId = 3, Name = "Zelda" });
      cust.Add(new Customer() { CustomerId = 4, Name = "Kim" });
   }

   public IQueryable<Customer> Get()
   {
      return cust;
   }
}

*What terms fit best? *

Are ‘Customer’ a Model (tooked from MVC)?
Does we, simply put, mean the same with POCO?

What do I call the sample typed data above? Mocks? Simply “Data”?

What do I call the object CustomerContext? A repository? A Context? Is it an Entity?

Are there other terms that have escaped this scope?

It appears common to write about repositories and generics, even though fell into a scope of a manufacturer (where i.e. ‘Entity’ commonly means Entity Framework). A strong indication of what terms means what (and when), would be of help.

0

Are ‘Customer’ a Model? Which it appear to be called in MVC?

Yes, it can be called a Model. Often in MVC, the Model is not simply a single business entity – it could, for example, be a collection of multiple entities and various user settings rolled into one, everything the View needs to be able to do its job.

Does we, simply put, mean the same with POCO?

Yes, it’s a POCO, because you are not implementing any specific interfaces, or inheriting from some entity framework.

What do I call the static typed data (in such case)? Mocks? Simply “Data”?

I would probably call it test data. It’s kind of hard to call it a “mock” since it seems to be your primary implementation at this point. I’ve never encountered the word mock being used outside the context of unit testing, what you have here seems to be more in line with the term “fake” (see Wikipedia’s article on these particular terms).

What do I call the object CustomerContext? A repository? A Context? Is it an Entity? I often confuse these terms with what I mean.

It looks like it’s the beginnings of a Repository Pattern.

As an aside, List<Customer> cust; is a fairly bad naming convention – try not to use abbreviations. It will be confusing when the Custodian, Custard and other similar classes start making appearances in your code 🙂

5

Are ‘Customer’ a Model? Which it appear to be called in MVC?

In my opinion: Customer, is a DTO (Data Transfer Object). As it is right now, there’s no logic or behaviour built into Customer – this is generally what separates it from being a business entity, domain entity or anything of that sort. Because of that, I wouldn’t necessarily call it a model exactly, or I’d say that your model is anemic (or you’ve just over-simplified the example and this doesn’t apply).

Does we, simply put, mean the same with POCO?

This you really could have just looked up first. Either way, POCO is often used in the context of an ORM. It simply means that you aren’t forced to inherit some base entity type that is required by your persistence framework.

What do I call the static typed data (in such case)? Mocks? Simply “Data”?

As Daniel B states, it’s test data. A mock is an object where you provide the expectations that the object should return (at run/test time). A Fake is roughly the same thing, except that the expectations are often provided at design time. There’s a good writeup here.

What do I call the object CustomerContext? A repository? A Context? Is it an Entity? I often confuse these terms with what I mean.

Based on all of your questions, I suggest some reading/research:

  • Repository Pattern
  • Context Pattern

And, last, and most important of all: the major benefit of design patterns is that they provide the ability to communicate about code at a more efficient and more abstract level. I highly suggest a few good patterns books as this is exactly the problem you’re having. There are many questions on the SE network that have wonderful answers. For example.

3

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