UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UU Object Diagram



Alexey Parshin wrote:
> Several small comments, all IMHO.
>
> 1) The location of the classes should minimize crossing of the
> connections. StudyObject::Topic, for instance, may be moved down and
> pull several connected classes even lower. Looks like a half of the
> crossings would be gone after that.
+1 on this
>
> 2) I'd prefer all the classes to start from "C" prefix, like CStudyObject.
Umm... Do we have anything but classes in C++? I'm inclined to go with
Java-like naming
conventions:
- name spaces are all lower-case, single words (if you need two words in
name space,
  you have done something wrong - perhaps two-level namespace is in order?)
- ClassName has no spaces, words all start with upper case letter
- Abbreviations/acronyms are init-caps, even if normally it's all caps
  (HttpServletRequest)
- Typedefs are all lowercase single word with _t appended (attrlist_t)
>
> 3) I'd prefer to have CExplanationList instead std::list<Explanation*>
> to hide some implementation details. Internally, it should be done
> anyway.
either that, or typedef it to explanationlist_t. This highly depends on
whether we need to have same interface
to given no matter what. i.e. std::list can be substituted by
std::vector with no changes to code,
but not the other way around. std::map and __gnu_cxx::hash_map are
interchangeable, but map and
list aren't.. So, depending on needs, actual structure should either be
100% hidden
(by using aggregation), partially hidden (by deriving from container
class, and then if we ever change
the base, we can add own implementations for needed interfaces), or just
typedefed.
I do agree, that we want typedefs, if for no other reason, then to just
save typing.
Compare:
std::list<Explanation*>"::const_iterator it;
explanationlist_t::const_iterator it;
It gets even better with maps ;-)
>
> 4) Do we really need these {get,set} prefixes? I've stopped using them
> around 10 yrs ago and lived happily ever after :)
I personally have no preference either way.


-- 
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com


Authoright © Total Knowledge: 2001-2008