webrobert's avatar

"Naming things is hard"

so I end up with a model named PurchaseSaleDocument

this happened because I already had earmarked Document

and of course it gets exacerbated ... PurchaseSaleDocumentSet

and you can already guess, I have shorted the table names for sanity ps_documents

How do you handle this? What are some of your naming conventions to maintain sanity?

Do I just smile at my long ass names and be grateful I know what they are?

Oh and then PurchaseSaleDocumentSetStatus::class

0 likes
5 replies
vincent15000's avatar

That's a very good demonstration of the variety of names each one can choose.

I generally attempt to use very simple names, for example if I have article types, I prefer the name types.

But the problem is when I have article types, book types, ...

If I have only one type of document, I don't search a more precise name.

Sinnbeck's avatar

I often namespace instead of make longer model names. I then set the table name manually

1 like
webrobert's avatar

@Sinnbeck so just follow around with a directory...

Models/PurchaseSale/

...Controllers/PurchaseSale/

Enums/PurchaseSale/

I typically do that for features in my views and http... so Post, Reply, Todo. But PurchaseSale is... a domain I guess, so I hadn't consider it.

1 like
Sinnbeck's avatar

Hmm. I can no longer click reply on a post? On mobile @jeffreyway

@webrobert i mean i have /Models/TimeRegistration/Entry, which points to timereg_entries

1 like
jlrdw's avatar

If all of this isn't separate relations, just but more into one model. Like PurchaseSaleDocument seems you could find it and load it. Of course I don't know your data, so just my thoughts.

For reports I don't even bother with eloquent, I use regular queries with getPdo().

1 like

Please or to participate in this conversation.