2018-05-07 12:25 GMT+02:00 Alidra Abdelghani via Pharo-users <
[email protected]>:

>
>
> ---------- Přeposlaná zpráva ----------
> From: Alidra Abdelghani <[email protected]>
> To: [email protected]
> Cc:
> Bcc:
> Date: Mon, 7 May 2018 11:25:49 +0100
> Subject: Package extension. Adding instance variables to classes
> Hi,
>
> I am working on a package named ClassNamesAnalyzer and I need to add code
> to third party classes in other packages (for instance the FAMIX-Core
> package).
> “Extending” third party classes with methods is easy; I just need to
> categorise my methods under the *ClassNamesAnalyzer protocole so that
> loading my package will load them in the image.
> However, if I want to add instance variables to theses classes, they are
> not there when I load the package in a new image.
>
> *So my question is* : is there a way to include instance variables
> addition to other packages in my package?
>

Currently not, you should use privateState


> *Another question is* : is it good practice to add instance variables to
> classes in third party packages and is there a way to avoid it (because I
> am not very confortable with that idea)?
>

It is not, see FAMIXContainerEntity>>#definedAnnotationTypes how this issue
is currently being solved using the privateState.

Cheers,
-- Pavel


>
> Thanks in advance,
> Abdelghani
>
>

Reply via email to