Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!


Walden University Package Planning and Abstract Factory Pattern Project

Walden University Package Planning and Abstract Factory Pattern Project

Walden University Package Planning and Abstract Factory Pattern Project


I am trying to learn how to create an abstract factory from an existing code and then refactor the existing code. Enclosed are a couple of screen shots from the Java file. I believe the Abstract Factory would be inserted at line 47.

Plan class is a tightly coupled factory. The part of the constructor that chooses absorbents and special cautions based on spill type can be modified to use the Abstract Factory pattern to get the correct absorbent and cautions once the spill type is known, without any further logic. This decreases the coupling by removing the knowledge of absorbent and caution details and moving it into subclasses specifically designed for that information.

The Plan constructor method creates the correct plan for a situation based on input from a responder about an emergency chemical spill. Instead of having the Plan make decisions and update state variables in both the absorbents and the cautions objects, I am trying to encapsulate this logic as an abstract factory. The old conditional can then be refactored into a compact choice of which concrete factory to use, based on the spill material.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Top Grade Essays only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Top Grade Essays are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Top Grade Essays is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Top Grade Essays, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.