Question: Machine Problem 2 (100 points) Design a battle scene in a video game. Create a maven project named cps278_mp2_xml Add the spring dependencies to the

Machine Problem 2 (100 points) Design a battle scene in a video game. Create a maven project named cps278_mp2_xml Add the spring dependencies to the project (same ones we used in learning unit 2) Create a BattleGround Interface: with one abstract method getBattleGroundDesc (method should return String) Create a FightingPower Interface: with one abstract method getFightingPowerDesc (method should return String) Create a couple of implementations of BattleGround Create a couple of implementations of FightingPower Create a class called Character. Character class should include: Attributes: name: String health: double or int strength: double or int fightingPower: an implementation of FightingPower Interface Method: useFightingPower: sysout how the character fights using a particular fightingPower. name+getFightingPowerDesc. For example: Tom Nook is throwing fireballs. Create a class called Battle. Battle class should include: Attributes: character1: Character Class character2: Character Class battleground: an implementation of BattleGround Interface Method: fight: sysout the information of the battleground and how each character uses their fightingPower. For example: On Naboo, Tom Nook and KK Slider are fighting. Tom Nook is throwing fireballs. KK Slider is swing the master sword. Use the knowledges we learned in Learning Unit 2: First Try: (using XML bean configuration metadata and annotation) Use @Component to create 2 FightingPower beans and 1 BattleGround bean. Create 2 Character beans using bean configuration metadata (xml):the configuration file should be located in src/main/resources Use annotation to create a Battle bean. Use annotation to inject all the dependencies in the Battle bean. Create 2 java apps: IOCApp1.java-this app should invoke the IoC container using the FileSystemXmlApplicationContext IOCApp2.java-this app should invoke the IoC container using the ClassPathXmlApplicationContext Run both Java programs and make sure you see the right output. Second Try: (using Java Config) Copy and paste cps278_mp2_xml, rename it to cps277_mp2_java_config Remove the bean configuration metadata file (xml) Create a Java Config file to configure all the beans. (see DI_JavaConfig_Demo2) Run the Java program and make sure you still see the same output *Include constructors, getters and setters as needed *Have fun but please only make PG or PG13 battle scenes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!