Hello,
Does anyone have any business object naming conventions they'd like to share?
My project is going to have lots of business objects, and I'm starting to struggle with how I should name them. Right now I've got classes like "PrintItemEditableRootWithChildren", "PrintItemReadOnlyRootList" and "PrintItemReadOnlyChild" etc. I know it's time to standardize things when I start renaming my classes over and over.
Thanks,
Mike
Hi hurcane,
I know what you mean when trying to name DB stuff, I've used different conventions there and I guess it's ok if you know the convention. Still, I struggle.
When it comes to CSLA business objects, I'm not so sure. This is no doubt related to that I use CodeSmith and those templates, and there are different names (templates) for the same base CSLA type. I've noticed that some classes that derive from the same type have more methods than the other, and I'm in the process of trying to figure out each one's purpose (I'm new to both CSLA and CodeSmith).
Regardless, I can see where I might have a PrintItem, which is an editable root, and a PrintItem, which is a read-only root, so I can't name both classes "PrintItem".
I just thought I'd ask if someone has an "official" naming convention instead of creating my own. By "official" I just mean something that has worked ok in a multi-developer environment.
Thanks,
Mike
Michael Hildner:Regardless, I can see where I might have a PrintItem, which is an editable root, and a PrintItem, which is a read-only root, so I can't name both classes "PrintItem".
There's no right answer with this, so whatever works best for you is the right answer.
For what it's worth, currently we're using a convention very similar to the one described by DancesWithBamboo.
We use namespaces to differentiate between editable and read-only objects. And we use the suffix List to mean collections of items.
So for example,
Company.Product.Business.Person
Company.Product.Business.PersonList
Company.Product.Business.ReadOnly.Person
Company.Product.Business.ReadOnly.PersonList
HTH
Thanks all for the replies. I realize there's no definitive answer as it's just a naming convention, I was just fishing for ideas.
hurcane, I guess the email I got on your initial reply didn't have all the info - that is I didn't see your listing when I replied to that. You were clear on your first post, thanks.
Regards,
Mike
Copyright (c) Marimer LLC