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

Test for Interface membership

Is there any way to determine if a class is a member of an interface?
For a concrete example: I am implementing a "node" (Node_if) interface
on database record representing objects (children of the abstract class
Data_class) that reflects that certain records have a parent-chld
relationship. (Others do not).

I'm generating a library Ordering_class that handles sorting operations
(i.e., users view a report of ordered objects and can move a specific
record up or down the listing with methods like
Ordering_class::move_up(Data_class $obj) ).

Naturally the ordering behavior of Node_if members will be different
than the ordering behavior of "flat" tables. (reordering behavior of
Node_if members will be restricted to siblings; reordering of
non-Node_if members can affect any member of the table)

Is there any way for Ordering_class::move_up(Data_class $obj) to test
$obj to determine that it is or is not a member of Node_if?

Jul 28 '05 #1
2 1123
ZeldorBlat wrote:
Check out is_a() and is_subclass_of();

http://www.php.net/manual/en/function.is-a.php
http://www.php.net/manual/en/functio...ubclass-of.php


PHP 5 *does* do interfaces, but I fail to excited about them - everytime
I've needed to know that much about an object, I just use method_exists()
or is_set().

HTH

C.
Jul 29 '05 #3

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

Similar topics

0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
4
by: Tim Conner | last post by:
I wrote the following function to test a string for characters from a to z and the "_" character : public static bool IsAlpha( char Value ) { Regex regExp = new Regex("^*$"); if...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
9
by: Paul Keegstra | last post by:
Hi, I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002 database for storing user information. ...
2
by: Balaji | last post by:
Hi All, Can I use more than one membership provider for a given website? I understand only one of them could be default one. If yes, then how to programmatically access the other membership...
10
by: Michael B. Trausch | last post by:
Alright, I seem to be at a loss for what I am looking for, and I am not even really all that sure if it is possible or not. I found the 'pdb' debugger, but I was wondering if there was something...
4
by: stj911 | last post by:
http://counterpunch.org/rahni04072007.html Test Tube Zealots: The American Chemical Society Terminates the Membership of Chemists from Iran By DAVID N. RAHNI The American Chemical Society...
4
by: Max2006 | last post by:
Hi, I am using ActiveDirectoryMembershipProvider for authentication. In my development environment I don't have any Active Directory available for development and test. Basically my development...
0
by: Craig Buchanan | last post by:
I have created a page to display a user's contact information. I would like to add a GridView to display the user's group membership. I was planning to use a multiview to segment the contact...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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...

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.