Could you please evaluate the suggested implementation


Assignment task 1:

In Java, programmers manage exceptions by using five keywords: try, catch, throw, throws, and finally. Structured programming techniques can handle expected exceptions such as insufficient data, out-of-range values, and bad formatting. With structured programming, code becomes messy quickly and can hide the true purpose of the programming code (Oracle, n.d.). 

The existence of a dynamic exception handling option provides the programmer with a dynamic exception object that travels back through the dynamic call chain to where the exception handler determines how to appropriately handle the exception potentially with information from the exception object (Rhodes, 2022). The try-catch-throw option provides much more flexibility for the programmer and a cleaner coding approach to exception handling. Exceptions enable programmers to write the main flow of code and handle exceptions elsewhere. Finally, error types can be grouped and handled together with an option to handle all exceptions similarly (Oracle, n.d.).

In summary, the WERS application works with expected data conditions. Handling the number and type of exceptions becomes increasingly more complex in real-world data entry and storage situations. The catch-throw exception-handling techniques enhance the programmers' ability to address real-world exception conditions for production data collection, writing, and retrieval. Each of these situations improves with the catch-throw exception-handling by allowing for effortless program flow, simplified support of programming, and robust error handling based on the exception source object.

Question: Could you please evaluate the suggested implementation and, if possible, suggest an alternative approach?

Assignment task 2:

One of the advantages of conditional statement used for exceptions handling in WERS system is that the conditions can be manually generated in if-else according to the task of handling exception. But the WERS system using of many 'if-else' the blocks to handle exceptions and the codes inside these blocks might get mixed, which can become unreadable and can turned into its disadvantage ("Difference between try-catch and if-else statements", 2021). One advantage of using try and catch instead of if-else statements in the WERS system is that it will check the system generated errors or exception during an executing process or a task and the codes to handle the exceptions and what exceptions to be handled are easily readable. But some times the try and catch can be more time consuming for the WERS system than if-else statement ("Advantages of exception handling", 2015).

After evaluating the advantages and disadvantages of using conditional statements and try and catch, I think I would select try and catch for implementation for exception handling. I will use it in the WERS system to handle the exceptions because in try section we can define the code that can be tested whether the code generates an unexpected result while executing, and if any unexpected result is found then catch block is executed to handle that situation. The use of try/catch blocks will segregate error-handling code and program code making it easier to identify the logical flow of a program. Separating error handling and program logic in this way makes it easier to understand and maintain programs in the long run ("Advantages of exception handling", 2015). In the WERS system, I would replace the conditional statement i.e., if-else statements with exceptional handling features to implement try/ catch.

Question: Could you please evaluate the suggested implementation and, if possible, suggest an alternative approach?

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Could you please evaluate the suggested implementation
Reference No:- TGS03286478

Expected delivery within 24 Hours