Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help Design and create the UML diagrams for a factory robot controller that

ID: 3785602 • Letter: N

Question

Need help Design and create the UML diagrams for a factory robot controller that sends commands to multiple robots in an assembly line to create a specific object following a sequence of predetermined steps. There are three types of robot: Drilling robot, which drills holes in a part. Welding robot, that welds parts together. Assembly robot, that combines parts together (e.g., putting hinges on door frames and subsequently putting doors on hinges) The design must be subject to the following requirements (Using standard requirement notation MoSCoW): The controller and its robots must be designed using the Abstract Factory pattern The Assembly robot must be designed using the Decorator pattern All classes must appear in at least one class diagram All diagrams must conform to UML 2.0 At least one use case diagram should be part of the submission A sequence diagram or equivalent behavioural diagram could be part of the submission

Explanation / Answer

public interface IBehaviour{

public int moveCommand();

}

public class DrillingRobot implements IBehaviour{

public int moveCommand()

{System.out.println(" drilling:if selected drill hole");

return 1;

}

public class WeldingRobot implements IBehaviour{

public int moveCommand()

{System.out.println(" welding:if selected weld the parts together");

return -1;

}

public class AssemblyRobot implements IBehaviour{

public int moveCommand()

{System.out.println(" assembling:if selected assemble the parts together");

return 0;

}

}

public class Robot{

IBehavioue behaviour;

String name;

public Robot(String name)

{this.behaviour=behaviour;

}

public IBehaviour getBehaviour()

{

this.behaviour=behaviour;

}

public void move()

{

System.out.println(this.name+":Based on current position");

int command=behaviour.moveCommand();

System.out.println(this.name + ""');

}

public String getName(){

return name;

}

public void setName(String name){

this.name=name;

}

public class Main{

public static void main(String[] args){

Robot r1=new Robot("abc");

Robot r2=new Robot("def");

Robot r3=new Robot("xyz");

r1.setBehaviour(new DrillingBehaviour());

r2.setBehaviour(new WeldingBehaviour());

r3.setBehaviour(new AssemblingBehaviour());

r1.move();

r2.move();

r3.move();

}}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote