naming guidance for typed lists and typed views

Posts   
 
    
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 24-Jun-2011 04:58:14   

So I am curious if anyone has any guidance or recomendations on how to name our typed lists and typed views, so that when they are generated they make sense to the users of our generated code?

For example, I have a table, MessageHistory. I want to build a typed list that contains come other information from related tables, so I build a typed list. Awesome.

But wait... I cant use MessageHistory because I already have a MessageHistory entity. I could create a new group and create the typed list in there but that feels odd.

So, I name my typed list "MessageHistoryList", but the generated code comes out to be "MessageHistoryListTypedListRow" which is indeed a mouthful...

So what are the rest of you all doing?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-Jun-2011 08:04:11   

In my case, I follow this rules: - Entity names are always single (not plural). - TypedList are plural are those always represent a set of objects.

So, for instance if I have a Customers table, I name the entity "Customer" and the TypedList "Customers" or "Clients".

Also as normally the TypeList has more entities involved you can build a name with that. For instance if you have Order/Customer/Shipper typedlist, you can name it "OrdersAndRelatedData".

You also could use the aggregate function, the type of join or the filter you will use in the generated code. For instance if you will sum the OrderItem.Total field you can name the TypedList as "OrderItemTotals". If you will filter the TypedList at code (in the default code of the object) you can name it "OrdersFromUK", etc.

David Elizondo | LLBLGen Support Team
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 29-Jun-2011 16:30:07   

This is excellent advice, thank you.

I renamed my lists to: MessageHeadersWithKeys MessageExceptionsWithBody

It worked out nicely, albiet, a bit verbose, but it fits the bill.