|
From: Nick C. <nic...@ve...> - 2003-04-08 12:53:10
|
Hi, The schedule architecture isn't really designed for inheritance in the sense of allowing polymorphmic behavoir. The only inheritance there is, is for code resuse by Schedule and SubSchedule. Now that SubSchedule has been deprecated we were thinking of merging Schedule and ScheduleBase. The reason then that fillGroup is private is simply that Schedule doesn't need to call it. More broadly though the schedule architecture isn't really designed for polymophism because we never thought anyone would really want to replace it. That said, I'm very glad you are doing what you are doing, and we will revisit this issue in the next release, probably by creating an ISchedule interface of which Schedule is an implementation. In your case, you can keep doing what you are doing (working with your own copy of ScheduleBase) in the near term. Alternatively, you could just override preExcecute() in ScheduleBase as that's the only place that fillGroup is called. Nick On Mon, 2003-04-07 at 20:53, Andy Cleary wrote: > Dear Repast developers, > > For my own project, I am trying to extend Repast's ScheduleBase and > Schedule via inheritance, but have run into a problem with protections... > Namely, in ScheduleBase, the member function fillGroup is private. > > I don't have a tremendous amount of experience with protection levels in > Java; I tend to use public or protected when I think of it, and package > level when I forget. ;-) So, I suppose question number one is whether or > not there are compelling reasons for this particular choice. Question 2 is > what would you recommend I do about it? For the time being, I'm going to > munge my copy of Repast to make this protected, but I don't want to do that > longterm. Is this the forum by which I should ask if that protection can be > revisited for the next release? > > If there are more elegant solutions, by all means let me know what they > are... I'm trying to override the preexecute function to incorporate some > (very basic) parallel synchronization. If I'm correct, I don't have to > override fillgroup, just call it as is currently being done... > > Best, > Andy > > ============================================ > Andrew J. Cleary, Software Engineer/Computational Scientist > Lawrence Livermore National Labs, 925-424-5890. > ============================================ > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Repast-developer mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-developer -- Nick Collier <nic...@ve...> |