473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Data Repository Class & Inheritance Question

I have made a Data Repository Class that holds all the Methods for the
Objects that i use in my System such as Order,Client,etc

Example for what i want to do: In the Client Class I want to inherite
from the "DataRepository Class" **ONLY** the methods that is related to
the Client such as GetClientInfo(). and the Same for the Order Class i
want to inherite **ONLY** the methods related to the Order such as
GetOrderIno()

how to do this in OOP? if anyone is able do demostrate and example for
such CASE of Selective Inheritance that would be Very Helpful.

thanks

Sharing makes us all Better

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 11 '05 #1
3 2292
Hello Dave,

The way to conform your request, u need to create facade classes with methods
only you need.
For example create ClientFacade, with one method that will redirect only
GetClientInfo() calls.
Your client should inherits from facade class.
The same for the Order class
DJ> I have made a Data Repository Class that holds all the Methods for
DJ> the Objects that i use in my System such as Order,Client,etc
DJ>
DJ> Example for what i want to do: In the Client Class I want to
DJ> inherite from the "DataRepository Class" **ONLY** the methods that
DJ> is related to the Client such as GetClientInfo(). and the Same for
DJ> the Order Class i want to inherite **ONLY** the methods related to
DJ> the Order such as GetOrderIno()

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Dec 11 '05 #2
Thanks Michael for your fast reply, But i am totally unfamiliar with the
facade classes approach, could u be more helpful if you support your
approach with a Code Snippet, That would be Really Helpful, Thanks in
foreward.

Sharing makes us all Better

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 11 '05 #3
Hello Dave,

U have "DataRepositoryClass" with several methods and "ClientClass" need
to see and use only DataRepositoryClass::GetClientInfo().

The way to do it - to create additional class "ClientFacade" that will be
derived by ClientClass
ClientFacade class need contains at least one method GetClientInfo that will
call DataRepositoryClass::GetClientInfo().

DJ> Thanks Michael for your fast reply, But i am totally unfamiliar with
DJ> the facade classes approach, could u be more helpful if you support
DJ> your approach with a Code Snippet, That would be Really Helpful,
DJ> Thanks in foreward.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Dec 11 '05 #4

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

Similar topics

9
by: mead | last post by:
What kind of classes is qualified as "concrete classes"? When should a member function in a class defined as "pure virtual" and when as "virtual"? Thanks!
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
0
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank...
5
by: jqpdev | last post by:
Hello all... I'm coming from a Borland Delphi background. Delphi has a specific component called a Data Module. In the designer the Data Module behaves like a windows form. A developer can...
3
by: Trammel | last post by:
Hi, I recently upgraded to VB.net from VB6.. and woah... I feel lost :¬O One of my reasons for upgrading is I was told that VB.net can do class inheritance and subclassing easier. ...
3
by: PJ6 | last post by:
First up, I know I'll get some good answers here, but in general, are there any newsgroups devoted to overall application architecture? Second, sorry for cross-posting but in this case I think...
1
by: DelphiLover | last post by:
Hi. I'm reading and reading, testing and testing, trying to figure out how to do things, how to do things according to best practises and how to do things in the best object oriented way. ...
1
by: Anthony Smith | last post by:
Let's say that I have some data like what is listed below. I simply want to get all of he text that is between the html tags. How would I do that with regular expressions or any kind of code. Also,...
5
by: hanna88 | last post by:
hello, im having problem to copy the data from iostream& into string.and im not sure am i doing the right way by using getline.can anyone give hints how to solve this. here's to make things...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.