#Is it possible to have a populate file and reuse it two other files with dynamic import?

13 messages · Page 1 of 1 (latest)

jagged streamBOT
#

This post has been reserved for your question.

Hey @tranquil igloo! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

winter phoenix
#

Unclear. Do you have actual code?

tranquil igloo
#
public class CarPopulator{

    public void pupolateFromCar(DataStructure dataStructure, Car car) {
        clearValues(dataStructure);
        setCAR(dataStructure, car);


    public void copyFromTemplate(DataStructure template, DataStructure target) {
        clearValues(target);
        target.setTICOMPANY(template.getCAR());
        
    }

    private void setOWNER(DataStructure dataStructure, Car car) {
        dataStructure.setCAR(train.getCAR());
    }```

Then in my a100 I do
And the DataStructre are from a100
```java
private CarPopulator<DataStructure> carPopulator= new CarPopulator<DataStructure>();
carPopulator.populateFromTrain(template, car); ```

ANd in my a90

And the DataStructre are from a90
```java
private CarPopulator<DataStructure> carPopulator= new CarPopulator<DataStructure>();
carPopulator.populateFromTrain(template, car); ```

But in my Carpopulator I want to do DataStructure dynamic
winter phoenix
#

Can't see a difference between a90 and a100. Maybe skip less code. Show what's actually there

tranquil igloo
#

there are no difference just the type of the DataStructure

#

and i want to reuse the CarPopulator to both files

#

but the DataStrucutre need to have a type declared in CarPopulator but i want it to be dynamic

#

so I can reuse that one and pass in the DataStructure from a90 and a100

winter phoenix
#

Stop being cryptic

#

I showed you how your situation is unclear

#

So do the needful to clarify it

#

And you shouldn't have needed anyone to show you how you've been unclear. It's common sense