More Group Sites
Education Books
School Rankings
Jobless Net
Better Home
Enviro++
更好教育论坛


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post Go to first unread
hong  
#1 Posted : Tuesday, 17 November 2009 10:03:35 PM(UTC)
hong

Rank: Administration

Reputation:

Groups: AcademicCoachingSchool, admin, Administration, BookSeller, CatholicSchool, CoachingAdult, CoachingProfessional, CoachingSports, ExtraCurriculumCoaching, IndependentSchool, Moderator, MusicTeacher, PrivateSchool, PublicSchool, SelectiveSchool, tutor
Joined: 23/11/2008(UTC)
Posts: 501

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
Rss Feed  Atom Feed
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.