More Group Sites
School Rankings
Jobless Net
Better Home
Enviro++


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

Can an object be both a subject and an observer? Options · View
hong
Posted: Wednesday, November 18, 2009 2:03:35 AM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 329
Points: 693
Location: Australia
Can an object be both a subject and an observer?

Yes, it can. The object will need to inherit from both Subject and Observer classes. If this is the case, we may need to deal with loop.

You can also Combine the Subject and Observer classes. In Smalltalk, the Subject and Observer interfaces are defined in the base class Object. Like Smalltalk, class libraries written in languages that don't support multiple inheritance don't define separate Subject and Observer classes but combine their interfaces in one class so an object can act as both a subject and an observer without multiple inheritance.
Sponsor
Posted: Wednesday, November 18, 2009 2:03:35 AM
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.223 seconds.