Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E137 Exam - Topic 1 Question 5 Discussion

Posted by Antonio on Oct 04, 2025 at 01:12 AM

A client has a requirement to get the location of stores based on the zip code authored in the component dialog. Location needs to be pulled from an external API using OSGi services.

Which OSGi Service code snippet should be used to represent the requirement?

A)

@OSGIService(component = Service.class)

public class ServiceImpl implements Service {

@Override

public List getStoresByZipCode(String zipCode) {

List storeLocations = new ArrayList<>();

// Create an HTTP client

try (CloseableHttpClient httpClient = HttpClients.createDefault()) {

// Processing logic to get all the locations from external api

} catch (IOException e) {

}

return storeLocations;

}

}

B)

@Component(service = Service.class)

public class ServiceImpl implements Service {

@Override

public List getStoresByZipCode(String zipCode) {

List storeLocations = new ArrayList<>();

// Create an HTTP client

try (CloseableHttpClient httpClient = HttpClients.createDefault()) {

// Processing logic to get all the locations from external api

} catch (IOException e) {

}

return storeLocations;

}

}

C)

@Service(service = Component.class)

public class ServiceImpl implements Service {

@Override

public List getStoresByZipCode(String zipCode) {

List storeLocations = new ArrayList<>();

// Create an HTTP client

try (CloseableHttpClient httpClient = HttpClients.createDefault()) {

// Processing logic to get all the locations from external api

} catch (IOException e) {

}

return storeLocations;

}

}

Suggested Answer: B

Get Premium AD0-E137 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
34 comments · newest first
LA
Lashandra 6 months ago
I just want to pass!
LE
Lemuel 7 months ago
I see both sides.
FE
Felix 7 months ago
Still, A handles service better.
LA
Lashandra 7 months ago
Simplicity matters in exams.
LE
Lemuel 8 months ago
True, but B is simpler for beginners.
FE
Felix 8 months ago
But A is more aligned with OSGi standards.
LA
Lashandra 8 months ago
It’s straightforward with @Component.
LE
Lemuel 8 months ago
What’s good about B?
LA
Lashandra 8 months ago
I prefer Option B.
FE
Felix 8 months ago
It uses @OSGIService, which is more appropriate here.
LE
Lemuel 9 months ago
Why A?
TW
Twila 9 months ago
Wait, is D even a valid option?
LE
Leanora 9 months ago
I think A is the right choice!
RA
Rasheeda 9 months ago
I definitely remember that we should be using the right annotations for OSGi services, but I can't shake the feeling that Option A might be a trick question.
NO
Noe 9 months ago
I feel like I might be overthinking this. Wasn't there something about the service annotations needing to match the implementation? I can't recall clearly.
CR
Crista 9 months ago
I think Option B looks familiar; it seems like the standard way to declare an OSGi service. I just hope I’m not mixing it up with another question we practiced.
FE
Felix 10 months ago
I think Option A is the best choice.
GI
Gianna 10 months ago
I remember we discussed the differences between @OSGIService and @Component annotations in class, but I'm not entirely sure which one is correct here.
CL
Claribel 10 months ago
Option B looks solid for OSGi services.
IR
Irma 10 months ago
Not sure about C, seems off to me.
AL
Alease 10 months ago
B is definitely the way to go!
CO
Cornell 11 months ago
Option B is the way to go. Who needs those other fancy annotations anyway? Keep it simple!
WI
Willodean 11 months ago
Option B is the correct answer. The @Component annotation is the way to go for OSGi services.
SE
Selma 11 months ago
Haha, Option C is a trap! @Service is for Spring, not OSGi.
LA
Lazaro 11 months ago
I'm leaning towards Option B as well. The @Component annotation is the standard way to define OSGi services.
SH
Shakira 12 months ago
Option B looks good to me. The @Component annotation is the way to go for OSGi services.
EL
Elly 12 months ago
Based on the requirement to use OSGi services to pull data from an external API, I think Option B is the way to go. The @Component annotation is the standard way to define an OSGi service, and the implementation logic looks appropriate.
MO
Mona 12 months ago
Option A seems close, but the @OSGIService annotation is not the correct way to define an OSGi service. I'll double-check the OSGi service best practices to make sure I understand the right approach.
LA
Lashon 1 year ago
I'm a bit confused by the different annotations used in the options. I'll need to review the OSGi service definitions more carefully to understand the differences between @OSGIService, @Component, and @Service.
LA
Laine 1 year ago
I think Option B looks the most promising. The @Component annotation is the correct way to define an OSGi service, and the service interface implementation matches the requirement.
BE
Belen 6 months ago
↳ replying to Laine
Right! It handles the HTTP client properly too.
LO
Louisa 6 months ago
↳ replying to Laine
Plus, the implementation looks clean and straightforward.
VE
Velda 6 months ago
↳ replying to Laine
Definitely! It aligns well with OSGi standards.
KE
Kelvin 6 months ago
↳ replying to Laine
I agree, Option B seems solid. The @Component annotation is key.
0/2000 characters

Save Cancel