Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Hi Cetin
>>>Yes a namespace might not be same as a vcx but in .Net everything is an object and thus a namespace could easily be seen as a sort of classlib. Actually I don't bother myself with its definition much (and not sure I could describe it ever).
>>>Yes a class instantition and calling its functions would take more than calling a weekend function directly. OTOH weekstart, weekend and such functions are not good samples for class.
>>
>>Why not?
>
>Because I can't think of its properties that'd differ much. However think if that was a Calendar. Gregorian, Hijri etc calendars have different month names, lengths etc. If I would create something that would show a calendar I'd do that with a class and not a prg (I mean functions not prg based classes). ie:
>
>*class calendar
>MonthNames[...]
>DayNames[...]
>FirstDayOfWeek
>ShowCalendar()
>
>*class HijriCalenDar
>subclassed from calendar
>MonthNames[...]
>DayNames[...]
>FirstDayOfWeek=...
>
>*class GregorianCalenDar
>subclassed from calendar
>MonthNames[...]
>DayNames[...]
>FirstDayOfWeek=...
>
>Cetin
So you have a superclass calendar subclassed to different calendars. That is the same as having a superclass function and subclassed Weekday, weekstart methods called from a single common method or even encoded in a single common method.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement