moosetechnology / Famix

An abstract representation of source code. Famix is generic and can describe applications in multiple programming languages.
MIT License
12 stars 22 forks source link

Add `FamixStModel>>#newModelAddingAll:` to create a new expanded model #766

Open Gabriel-Darbord opened 2 months ago

Gabriel-Darbord commented 2 months ago

This simple method doesn't leave much room for configurability, but I'm not sure this feature needs it, as it's mainly a means to quickly expand an existing model. Projects that automate model creation can use the already existing FamixStPharoImporterTask API.

The idea is that if you're toying with a model and realize you're missing some dependencies, then instead of recreating a model by hand which is tedious because you have to select all previous packages plus the new one(s), you can just use this method, e.g.:

"Add ByteString class and the package containing Association"
newModel := myModel newModelAddingAll: { ByteString. Association package }
NicolasAnquetil commented 2 months ago

Is there an issue associated to this? Can we discuss it? Whatr was the problem? Because I din't understand why we would need a new method to add entities to a model ... ?

Gabriel-Darbord commented 2 months ago

There's no issue, but it can be discussed here. I gave the reasoning for this method in the original post:

The idea is that if you're toying with a model and realize you're missing some dependencies, then instead of recreating a model by hand which is tedious because you have to select all previous packages plus the new one(s), you can just use this method

Instead of using the UI to rebuild a larger model, you use this method. This is useful for sandboxing.

badetitou commented 2 months ago

I understand. Not sure it is mandatory, but if you have the case. Why not Before merging need test first!