Changes to course listings in 2.5

Re: Changes to course listings in 2.5

de către Gareth J Barnard-
Număr de răspunsuri: 7
Imaginea Core developers Imaginea Particularly helpful Moodlers Imaginea Plugin developers

Dear Marina and Tim,

I could be wrong about my assumption as it's how I perceive things at the moment from a functional design point of view.

I agree with Tim with the format_renderer_base still being abstract.

Understanding this from an OO / Java / C++ background perspective I would think that the theme would want to override certain functionality and a course format another.  If you have the structure:

format_renderer_base -> format_renderer_course_format_overrides -> format_renderer_theme_overrides

Because the theme wants to override some of what the course format is doing then you would need a class for each course format you wanted to support unless PHP supports multiple inheritence (nasty).

But as I understand it with what Tim is saying you would have:

plugin_renderer_base -> core_course_commonbits_renderer(abstract) -> format_renderer_base(abstract) -> format_renderer_course_format_overrides

and

plugin_renderer_base -> core_course_commonbits_renderer(abstract) -> theme_renderer_base(abstract) -> theme_renderer_theme_overrides

Such that the theme and the course format can perform overrides.  But what happens when there is a conflict?  Should themes and course formats do the same thing or should there be a distinction in functionality of responsibility?  Such that a theme does specific things and a course format does other specific things and never the twain shall meet.

Cheers,

Gareth

Ca răspuns la Gareth J Barnard

Re: Changes to course listings in 2.5

de către Tim Hunt-
Imaginea Core developers Imaginea Documentation writers Imaginea Particularly helpful Moodlers Imaginea Peer reviewers Imaginea Plugin developers

That is not what I am saying.

theme_renderer_base does not subclass core_course_commonbits_renderer.

"Prefer aggregation over inheritance."

Ca răspuns la Tim Hunt

Re: Changes to course listings in 2.5

de către Gareth J Barnard-
Imaginea Core developers Imaginea Particularly helpful Moodlers Imaginea Plugin developers

Dear Tim,

So if both the theme and the course format both aggregate core_course_commonbits_renderer in their abstract base classes how does the theme override any method that the course format does?

Cheers,

Gareth

Ca răspuns la Gareth J Barnard

Re: Changes to course listings in 2.5

de către Tim Hunt-
Imaginea Core developers Imaginea Documentation writers Imaginea Particularly helpful Moodlers Imaginea Peer reviewers Imaginea Plugin developers

I am wondering what sort of OO / Java / C++ knowledge you acutally have. You are not understanding what I say, and I am not in the mood to explain at greater length now.

Ca răspuns la Tim Hunt

Re: Changes to course listings in 2.5

de către Gareth J Barnard-
Imaginea Core developers Imaginea Particularly helpful Moodlers Imaginea Plugin developers

Dear Tim,

Perhaps I am not explaining myself, so I have drawn a class digram - attached.

Kind regards,

Gareth

Atașament th.png
Ca răspuns la Gareth J Barnard

Re: Changes to course listings in 2.5

de către Mary Evans-
Imaginea Core developers Imaginea Documentation writers Imaginea Peer reviewers Imaginea Plugin developers Imaginea Testers

The only way to keep this discussion from going belly up is to do what Marina says and test the course format renderers, and if they are found to be flawed then file it as a BUG in Moodle Tracker.

I'm too tired to read, and not knowledgeable enough about renderers to comment, although I have discovered a wonderful way to include plugin renderers in themes thanks to Tim, so I guess he knows what he is talking about. surâs

Have a nice weekend everyone. Please don't spend it renderers! bah humbug!

Don't worry be happy! cheers

 

 

Ca răspuns la Gareth J Barnard

Re: Changes to course listings in 2.5

de către Tim Hunt-
Imaginea Core developers Imaginea Documentation writers Imaginea Particularly helpful Moodlers Imaginea Peer reviewers Imaginea Plugin developers

Well, they say a picture is worth 1000 words, and your picture certainly qualifies. It is exactly right. Sorry I failed to understand what you were saying before.

Ca răspuns la Tim Hunt

Re: Changes to course listings in 2.5

de către Gareth J Barnard-
Imaginea Core developers Imaginea Particularly helpful Moodlers Imaginea Plugin developers

Dear Tim,

No worries surâs - just goes to show why class, object interaction, state transition diagrams... exist to describe the form and function of software.

Cheers,

Gareth