conduit icon indicating copy to clipboard operation
conduit copied to clipboard

Naming convension (plural or singular?)

Open zztczcx opened this issue 4 years ago • 1 comments

Hi, I am new to commanded and I come from the rails. I found there are two big contexts or aggregates. one is called blog (lib/conduit/blog), another is called accounts(lib/conduit/accounts).

I am not sure if we need to keep some kind of consistency for these two naming ?

which is better or how to choose , as in rails, we normally have convention about naming.

zztczcx avatar Oct 27 '21 22:10 zztczcx

I'm not sure whether there are any rules around whether contexts need to be consistently named in either plural or singular form. For example the Phoenix documentation on Contexts defines three contexts named as Catalog, ShoppingCart, and Orders.

Naming things is hard. If you're stuck when trying to come up with a context name when the grouped functionality in your system isn't yet clear, you can simply use the plural form of the resource you're creating. For example, a Products context for managing products. As you grow your application and the parts of your system become clear, you can simply rename the context to a more refined name at a later time.

You are free to enforce any convention you like, or none at all.

slashdotdash avatar Oct 28 '21 16:10 slashdotdash