[Cuis-dev] A question on same-named methods

Nicola Mingotti nmingotti at gmail.com
Sun Aug 15 23:57:54 PDT 2021


Hi Hillaire,

I since I am quite in hurry I am adding the methods I need to my project 
Package straight away.

After Phil explanation I know what will happen in case of doubly defined 
methods.
Since my package is loaded last from the boot script it will overwrite 
whatever it finds in its way.

I am not using the Image as a storage medium, everything comes from 
files and I
reboot Cuis every morning, at least.

That '(pre|post)PackageInstall' (or similar name) in Phil video is 
really interesting, I will use it.

I supposed that since the JSON package package is one of the items that 
gets retrieved
automatically from Cuis-Dev i should have just said the proposed changes 
here and that somebody would
have taken the appropriate decision. From your answer I deduce I was 
wrong. No problem.
I will fork and submit the changes to the JSON package maintainer.



Bye
Nicola






On 8/15/21 4:59 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> Phil already discussed what happens in that situation.
>
> Now from a practical point of view, regarding Smalltalk way, the right 
> move is to propose to the JSON package maintainer to add your class 
> side method readFromString: to the JSON package.
>
> After all, if you find this added method is convenient to read Json 
> files, it is likely to be convenient for other users of the JSON package.
>
> If the package maintainer does not agree, I don't know. May be the 
> safest way will be to subclass Json in your own package and add the 
> methods you need.
>
> Best
>
> Hilaire
>
> Le 14/08/2021 à 19:46, Nicola Mingotti via Cuis-dev a écrit :
>> I defined a method in my package 'Wunderbar', it is 'readFromString', 
>> which
>> goes into class 'Json class side' and method category '*Wunderbar-DB'.
>>
>> Now, suppose a day in the future I upgrade Cuis and 'readFromString'
>> is now defined into 'Json class'. What will happen when i try to load 
>> 'Wunderbar' package ?
>>
>> . Do i get an error for method name overlap ?
>> . If not, is there any criteria by which one method should be called 
>> instead of the other
>> for example: looking at which method category it belongs to ?
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210816/804e56cf/attachment.htm>


More information about the Cuis-dev mailing list