Which of the following are best practices for adding a new parameter to an existing method of
CommerceCartService? Note: There are 2 correct answers to this question.
Suggested Answer: B, D
Get Premium P_C4H34_2411 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
12 comments · newest first
NI
Nieves
10 months ago
Adding a property to the beans.xml file sounds familiar, but I can't recall if that's actually a best practice for this kind of situation.
EN
Ena
10 months ago
I remember we discussed extending the default implementation in class, so that might be one of the correct answers.
NI
Nikita
10 months ago
I think overloading the method could be a good option, but I'm not entirely sure if it's the best practice for this scenario.
ER
Ernest
10 months ago
I think the key here is to keep the existing method intact while still accommodating the new parameter. Overloading the method seems like the best way to do that.
JU
Juliana
10 months ago
Adding a new property to the beans.xml file doesn't seem like the right solution here. That's more for configuring the service, not modifying its behavior.
BO
Bobbye
11 months ago
I think A and D are the best options here.
QU
Quiana
11 months ago
Hmm, I'm leaning towards extending the default implementation to handle the new parameter. That seems like the most straightforward way to add the new functionality without disrupting the existing code.
RI
Rikki
11 months ago
I agree, A and D are the best options here.
CH
Chaya
11 months ago
A and D are the correct answers.
FA
Farrah
12 months ago
I'm a bit confused on this one. Should we be modifying the existing method or creating a new one? I'm not sure if extending the strategy or implementation is the right way to go.
KI
Kimberlie
12 months ago
I think the best approach here is to overload the existing method by adding the new parameter. That way we can keep the existing functionality intact while also handling the new requirement.
HO
Hobert
11 months ago
Yeah, but we should prioritize keeping the existing method functional.