1

I have java client object exposed to clients something like

public abstract class Vehicle{
    string id;
    string name;
    Enginer engine;
} 

public class MotorVehicle extends Vehicle {
    int numOfWheels;
}

public class Engine {
    Rotor rotor;
    Stator stator;
    AirGap airgap;
}

Now I have business level layer which is kind of same structure but little different in nature.

public abstract class VehicleBusinessModel{
    string id;
    string name;
} 

public class MotorVehicleBusinessModel extends VehicleBusinessModel {
    int numOfWheels;
}

public class EngineBusinessModel {
    Rotor rotor;
    Stator stator;
    AirGap airgap;
    Windings windings;
}

What will be best way to validate client structure and then convert to business structure ?

Thanks.

tumisma
  • 375
  • 3
  • 14
user3089214
  • 267
  • 3
  • 14

1 Answers1

0

For a project, I would use Dozer or Orika

If you have lower expectation on performances, you can use Apache Commons Beanutils, which is easier to use.

Community
  • 1
  • 1
Akah
  • 1,890
  • 20
  • 28