473,434 Members | 1,820 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,434 software developers and data experts.

Multiple Inheritance scenario

i'm a little confused as how to accomplish this

I have multiple actors in a timesheet system I am developing. Some of
the actors are: Administrator, Manager, Reviewer, DefaultUser, etc...
Now, all users inherit from DefaultUser, but I also want an
Administrator to inherit from a Reviewer. How would you accomplish
this?c# and vb do not support multiple inheritance. I was thinking
interfaces, but I am still cloudy on interfaces or abstract classes and
when to use each method.

Any help would be appreciated. Thank you

sean

Nov 29 '05 #1
6 1349
Dkode,

Yes Interfaces, however you can of course as well make

Actors
Defaultusers
SpecialUsers
Administrators
Reviewers

What is probably less work

Just my thought,

Cor
Nov 30 '05 #2
so if I use interfaces, I would re-coding correct? Since there is no
implementation in an interface, I would have to implement the
methods/properties in each class subscribing to the interface. This
seems like more work.

In your other example, would you use base classes? For instance:

Actors (Base Class)
DefaultUsers
SpecialUsers (Base Class)
Admins
Reviewers

is this what you meant?

Nov 30 '05 #3

Actors (Base Class)
DefaultUsers (inherits Actors)
SpecialUsers (inherits Actors)
Admins (inherits SpecialUsers)
Reviewers(inherits SpecialUsers)

is what I mean

:-)

Cor
Nov 30 '05 #4
I think that is exactly what I was looking for. Now that I am starting
to use interfaces and abstract classes in my apps, where can I find
good information on design patterns? I have read some articles and
design patterns at the Gang of Four website, but I dont really
understand how they work or when to use them. I guess the best thing to
do would be to get a book on design patterns. On the same note, would
learning about design patterns help out my class design?

Also in this example, I was reading about a Factory Class pattern where
you can have one class inherit from multiple base classes using a
Factory based approach. Is this something that would be beneficial to
me in this example?

I appreciate the advice. thanks

Sean

Nov 30 '05 #5
Hi Sean,

The best book IMO on design patterns (especially for beginners) is "Design
Patterns Explained" from Allan Shalloway and James Trott. Another very good
book in design patterns is "Patterns hatching" from John Vlissides.

As per your example it depends how you will be using classes. Factory
patterns is creational pattern meaning that it is used for creating objects.

hope this helps

Fitim Skenderi

"DKode" <dk****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I think that is exactly what I was looking for. Now that I am starting
to use interfaces and abstract classes in my apps, where can I find
good information on design patterns? I have read some articles and
design patterns at the Gang of Four website, but I dont really
understand how they work or when to use them. I guess the best thing to
do would be to get a book on design patterns. On the same note, would
learning about design patterns help out my class design?

Also in this example, I was reading about a Factory Class pattern where
you can have one class inherit from multiple base classes using a
Factory based approach. Is this something that would be beneficial to
me in this example?

I appreciate the advice. thanks

Sean

Dec 1 '05 #6
Yesterday I ordered that book from Amazon. I saw alot of people
recommending it on the newsgroups, so I figure I would buy it.

thanks for the advice.

Dec 1 '05 #7

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

Similar topics

6
by: Paul | last post by:
In real life situation, do we ever come across a situation where we would need two base objects in an object. A snippet is worth 1000 words (: so... class Base { }; class Derived1:public Base...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
29
by: MAHESH MANDHARE | last post by:
Hi , Can Anyone explain me exactly why multiple inheritance not used in java and c# thanks, Mahesh -- Have A Good Day, Mahesh, Maheshmandhare@yahoo.co.in
7
by: tshad | last post by:
I have a control that I am using from Metabuilders that requires you to use: <%@ Page Inherits="MetaBuilders.WebControls.DialogPage" %> How do I inherit my code-behind page or another object...
2
by: Heinz Ketchup | last post by:
Hello, I'm looking to bounce ideas off of anyone, since mainly the idea of using Multiple Virtual Inheritance seems rather nutty. I chalk it up to my lack of C++ Experience. Here is my...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.