Good OO organization os statistics data

  • Thread starter Thread starter Allan Ebdrup
  • Start date Start date
A

Allan Ebdrup

Hi
We have a large class library of different classes, now we are going to
implement a lot of usage statistics that we need, stuff like how many times
a user has logged in, how many times a message has been read, how many times
a ad has been shown and so on.
Now I'm wondering what would be a good OO organization of this data, should
the statistics be part of the objects they are for, or should statistics be
seperate.
Perhaps each object could have a statistics property that contains the
different statistics for that object.
How do you organize your statistics for your objects and what are your
experinces with this.

Kind Regards,
Allan Ebdrup
 
Not knowing a great deal about what you are doing, but I would recommend
coding the statistics properties within their designated objects rather than
have them separate.

Simon.
 
I always code metadata as a separate class IF I expecte the metadata to
become complex OR IF I a have a RAD metadata management subsystem (class
library).

The 'IF' separates a tatical code design from a strategic code design.

If the usage statistics become a 'entity unto themselves' then you can
leverage logging, tracing, presentation and other sub-systems/class
libraries. (assuming you have them
or want to build them).

If you are short on time, have just a few statistics or want a fast
prototype you may want to just make the statistics part of the object state.

Shawnk
 
Hi Allan,

I would prefer Simon's suggestion and put those Simon statistics
properties(methods or fields) into their designated class(as static
members). And only when there are large number of such statistics members
will I consider group them into a separate utility class(which contains
only those static methods or fields ).

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
You're welcome Allan,

Good luck!

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top