dbTalk Databases Forums  

How does one model behavior?

comp.databases.theory comp.databases.theory


Discuss How does one model behavior? in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
Leslie Sanford
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 10:30 AM







"David Cressey" wrote:
Quote:
"Leslie Sanford" wrote:
<snip>

Quote:
when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do it.
To me it's like working with algorithms (or behavior) and data structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly live
and I don't understand what it is you're asking. In which case, I welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do". This
might be close to what I'm asking for when I say "how to you model
behavior".
Well, I do it in code. Specifically at the class declaration. If a method
represents the means by which an object is sent a message, then I think it's
safe to say that the method name is also the name of the message. This name
should reflect what behavior occurs in response to the object receiving the
message. Using an example I posted in another thread:

// For fans of John Carpenter's first movie. :-)
class DarkStar
{
public:
void CancelBombDetonation();
};

Here DarkStar can receive a message to cancel bomb detonation. So what the
"class has to do" in response to this message is reflected in the message
name, i.e. cancel bomb detonation. Of course, there may be a reason why the
operation can't be carried out successfully, in which case an exception
should probably be thrown, but I'm going to ignore that for this discussion.

If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw out
a state transition diagram for a class. But that's about it.






Reply With Quote
  #42  
Old   
Leslie Sanford
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 10:30 AM







"David Cressey" wrote:
Quote:
"Leslie Sanford" wrote:
<snip>

Quote:
when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do it.
To me it's like working with algorithms (or behavior) and data structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly live
and I don't understand what it is you're asking. In which case, I welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do". This
might be close to what I'm asking for when I say "how to you model
behavior".
Well, I do it in code. Specifically at the class declaration. If a method
represents the means by which an object is sent a message, then I think it's
safe to say that the method name is also the name of the message. This name
should reflect what behavior occurs in response to the object receiving the
message. Using an example I posted in another thread:

// For fans of John Carpenter's first movie. :-)
class DarkStar
{
public:
void CancelBombDetonation();
};

Here DarkStar can receive a message to cancel bomb detonation. So what the
"class has to do" in response to this message is reflected in the message
name, i.e. cancel bomb detonation. Of course, there may be a reason why the
operation can't be carried out successfully, in which case an exception
should probably be thrown, but I'm going to ignore that for this discussion.

If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw out
a state transition diagram for a class. But that's about it.






Reply With Quote
  #43  
Old   
Leslie Sanford
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 10:30 AM




"David Cressey" wrote:
Quote:
"Leslie Sanford" wrote:
<snip>

Quote:
when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do it.
To me it's like working with algorithms (or behavior) and data structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly live
and I don't understand what it is you're asking. In which case, I welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do". This
might be close to what I'm asking for when I say "how to you model
behavior".
Well, I do it in code. Specifically at the class declaration. If a method
represents the means by which an object is sent a message, then I think it's
safe to say that the method name is also the name of the message. This name
should reflect what behavior occurs in response to the object receiving the
message. Using an example I posted in another thread:

// For fans of John Carpenter's first movie. :-)
class DarkStar
{
public:
void CancelBombDetonation();
};

Here DarkStar can receive a message to cancel bomb detonation. So what the
"class has to do" in response to this message is reflected in the message
name, i.e. cancel bomb detonation. Of course, there may be a reason why the
operation can't be carried out successfully, in which case an exception
should probably be thrown, but I'm going to ignore that for this discussion.

If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw out
a state transition diagram for a class. But that's about it.






Reply With Quote
  #44  
Old   
Leslie Sanford
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 10:30 AM




"David Cressey" wrote:
Quote:
"Leslie Sanford" wrote:
<snip>

Quote:
when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do it.
To me it's like working with algorithms (or behavior) and data structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly live
and I don't understand what it is you're asking. In which case, I welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do". This
might be close to what I'm asking for when I say "how to you model
behavior".
Well, I do it in code. Specifically at the class declaration. If a method
represents the means by which an object is sent a message, then I think it's
safe to say that the method name is also the name of the message. This name
should reflect what behavior occurs in response to the object receiving the
message. Using an example I posted in another thread:

// For fans of John Carpenter's first movie. :-)
class DarkStar
{
public:
void CancelBombDetonation();
};

Here DarkStar can receive a message to cancel bomb detonation. So what the
"class has to do" in response to this message is reflected in the message
name, i.e. cancel bomb detonation. Of course, there may be a reason why the
operation can't be carried out successfully, in which case an exception
should probably be thrown, but I'm going to ignore that for this discussion.

If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw out
a state transition diagram for a class. But that's about it.






Reply With Quote
  #45  
Old   
Leslie Sanford
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 10:30 AM




"David Cressey" wrote:
Quote:
"Leslie Sanford" wrote:
<snip>

Quote:
when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do it.
To me it's like working with algorithms (or behavior) and data structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly live
and I don't understand what it is you're asking. In which case, I welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do". This
might be close to what I'm asking for when I say "how to you model
behavior".
Well, I do it in code. Specifically at the class declaration. If a method
represents the means by which an object is sent a message, then I think it's
safe to say that the method name is also the name of the message. This name
should reflect what behavior occurs in response to the object receiving the
message. Using an example I posted in another thread:

// For fans of John Carpenter's first movie. :-)
class DarkStar
{
public:
void CancelBombDetonation();
};

Here DarkStar can receive a message to cancel bomb detonation. So what the
"class has to do" in response to this message is reflected in the message
name, i.e. cancel bomb detonation. Of course, there may be a reason why the
operation can't be carried out successfully, in which case an exception
should probably be thrown, but I'm going to ignore that for this discussion.

If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw out
a state transition diagram for a class. But that's about it.






Reply With Quote
  #46  
Old   
Leslie Sanford
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 10:30 AM




"David Cressey" wrote:
Quote:
"Leslie Sanford" wrote:
<snip>

Quote:
when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do it.
To me it's like working with algorithms (or behavior) and data structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly live
and I don't understand what it is you're asking. In which case, I welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do". This
might be close to what I'm asking for when I say "how to you model
behavior".
Well, I do it in code. Specifically at the class declaration. If a method
represents the means by which an object is sent a message, then I think it's
safe to say that the method name is also the name of the message. This name
should reflect what behavior occurs in response to the object receiving the
message. Using an example I posted in another thread:

// For fans of John Carpenter's first movie. :-)
class DarkStar
{
public:
void CancelBombDetonation();
};

Here DarkStar can receive a message to cancel bomb detonation. So what the
"class has to do" in response to this message is reflected in the message
name, i.e. cancel bomb detonation. Of course, there may be a reason why the
operation can't be carried out successfully, in which case an exception
should probably be thrown, but I'm going to ignore that for this discussion.

If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw out
a state transition diagram for a class. But that's about it.






Reply With Quote
  #47  
Old   
David Cressey
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 11:34 AM




"Leslie Sanford" <jabberdabber (AT) bitemehotmail (DOT) com> wrote

Quote:
"David Cressey" wrote:
"Leslie Sanford" wrote:

snip

when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do
it.
To me it's like working with algorithms (or behavior) and data
structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly
live
and I don't understand what it is you're asking. In which case, I
welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do".
This
might be close to what I'm asking for when I say "how to you model
behavior".

Well, I do it in code.
How well does this scale up?

Quote:
If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw
out
a state transition diagram for a class. But that's about it.
State transition diagram speakes to the question I was really asking.

A model doesn't have to be elaborate in order to be useful.

In data modeling, what is left out of the model sometimes makes the model
more useful for its intended purpose.





Reply With Quote
  #48  
Old   
David Cressey
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 11:34 AM




"Leslie Sanford" <jabberdabber (AT) bitemehotmail (DOT) com> wrote

Quote:
"David Cressey" wrote:
"Leslie Sanford" wrote:

snip

when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do
it.
To me it's like working with algorithms (or behavior) and data
structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly
live
and I don't understand what it is you're asking. In which case, I
welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do".
This
might be close to what I'm asking for when I say "how to you model
behavior".

Well, I do it in code.
How well does this scale up?

Quote:
If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw
out
a state transition diagram for a class. But that's about it.
State transition diagram speakes to the question I was really asking.

A model doesn't have to be elaborate in order to be useful.

In data modeling, what is left out of the model sometimes makes the model
more useful for its intended purpose.





Reply With Quote
  #49  
Old   
David Cressey
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 11:34 AM




"Leslie Sanford" <jabberdabber (AT) bitemehotmail (DOT) com> wrote

Quote:
"David Cressey" wrote:
"Leslie Sanford" wrote:

snip

when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do
it.
To me it's like working with algorithms (or behavior) and data
structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly
live
and I don't understand what it is you're asking. In which case, I
welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do".
This
might be close to what I'm asking for when I say "how to you model
behavior".

Well, I do it in code.
How well does this scale up?

Quote:
If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw
out
a state transition diagram for a class. But that's about it.
State transition diagram speakes to the question I was really asking.

A model doesn't have to be elaborate in order to be useful.

In data modeling, what is left out of the model sometimes makes the model
more useful for its intended purpose.





Reply With Quote
  #50  
Old   
David Cressey
 
Posts: n/a

Default Re: How does one model behavior? - 04-09-2008 , 11:34 AM




"Leslie Sanford" <jabberdabber (AT) bitemehotmail (DOT) com> wrote

Quote:
"David Cressey" wrote:
"Leslie Sanford" wrote:

snip

when designing a class I decide what it needs to do,
and this goes hand in hand with what it needs to know in order to do
it.
To me it's like working with algorithms (or behavior) and data
structures
(or data). I can't say if one comes before the other.

Could be my head is stuck at the code level which is where I mainly
live
and I don't understand what it is you're asking. In which case, I
welcome
enlightenment/clarification.

Sorry. I don't know enough OO to provide enlightenment. I understand
data pretty well.

Perhaps you could tell me how you express "what a class has to do".
This
might be close to what I'm asking for when I say "how to you model
behavior".

Well, I do it in code.
How well does this scale up?

Quote:
If we want to go further, we could specify the pre/post conditions of this
message. How strongly this can be expressed in code depends on the
programming language.

At any rate, for me, this is how it works. I don't use UML or any kind of
notation to design my classes. I do it in code. I may sit down and draw
out
a state transition diagram for a class. But that's about it.
State transition diagram speakes to the question I was really asking.

A model doesn't have to be elaborate in order to be useful.

In data modeling, what is left out of the model sometimes makes the model
more useful for its intended purpose.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.