473,507 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

assign responsibility

public abstract class Animal
{
private string Id;
}

public class Dog : Animal
{
//properties/fields for Dog
public void Add()
{logic to persist to database}

}

We'd like Dog to persist himself to database. We'd like classes
derived from Animal to always have a GUID in Id. But derived classes
should not worry about that, they don't have to know about the Id.
How do we do this while making Dog responsible to add himself? We
don't want to use Animal constructor because Id is only used for
Insert. Ideas? thanks! Marty
Nov 22 '05 #1
2 1176
Cor
Hi Marty,

Please stay in the same thread and do not message twice, I saw Peter did
answer your previous question but for the same someone else had started to
evaluate your question again.

Cor
Nov 22 '05 #2
That is my mistake, I apologize. I posted from work, did not see my post in
the group and thought that the post did not work properly. So I posted
again at home. I should let some time pass before I assume there was a
problem with the original post. Thanks for the reminder!

"Cor" <no*@non.com> wrote in message
news:eH*************@TK2MSFTNGP09.phx.gbl...
Hi Marty,

Please stay in the same thread and do not message twice, I saw Peter did
answer your previous question but for the same someone else had started to
evaluate your question again.

Cor

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3745
by: N | last post by:
Is there anyone can tell me if the following statement is true? DBA are not experts on SQL. So they are not programmers and can't always answer programming questions. The example of...
3
1405
by: Marty McDonald | last post by:
public abstract class Animal { private Id; public } public class Dog : Animal { <<fields/properties for Dog>>
5
44788
by: vince | last post by:
I want to assign a null value to a DateTime variable.How do i do that? Thanks Vince
26
7031
by: Brett | last post by:
I have created a structure with five fields. I then create an array of this type of structure and place the structure into an array element. Say index one. I want to assign a value to field3 of...
6
2247
by: david | last post by:
I try to use "for" loop to retrieve and assign values in web form. The code is in the following. But it can not be compiled. What I want to do is: txtQ1.Text =...
7
2501
by: Edward Diener | last post by:
Since implement the assign operator for reference types eliminates the ability to assign a reference object to a reference variable of the same type or base class of that type, I assume that...
4
6893
by: Chris Roth | last post by:
vector<doublev1(5,1); vector<doublev2; v2 = v1; // 1 v2.assign(v1.begin(),v1.end()); // 2 Are 1 and 2 the same, or are their subtle differences between them. Which is preferable, if either? ...
2
2902
by: Ora | last post by:
Hi all, Can any one help me in getting the list of users associated with a responsibility in Oracle Apps. Thanks,
2
1433
by: Cramer | last post by:
More of a theoretical question here: It just occurred to me that the ASP.NET request pipeline delivers much of the GoF Chain of Responsibility pattern. What do you think? If it does not, then, why...
3
1939
by: vamsioracle | last post by:
Can any one help me out, how to implement a rule for delegation of responsibility in SSHR Absence management. Thanks vamsi
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.