Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 241089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:43:26+00:00 2026-05-11T20:43:26+00:00

I’m adding some logic to my web app to lookup geo-coordinates for a user,

  • 0

I’m adding some logic to my web app to lookup geo-coordinates for a user, store them, then using those coordinates lookup the timezone and store that. My first go at this was to add a GeoCodeUser() method to a MappingService i had defined to do other map-related tasks. Because looking up the two bits of data relied on two different REST services, I broke the two lookup tasks into AddressGeoCoder and TimeZoneCoder and used those to retrieve the data and the UserRepository to store them. The odd part of this solution is that though this method needs access to the repository and two ‘coders’, the other methods in the class didn’t. So every time I use that service to do other things I’m getting dependencies I don’t need and then dropping them. So here is what I am wondering:

  • Should this be in a service (since it’s coordinating different operations) or possible in the ‘User’ model object itself?

  • If so, should I be defining a service based on it’s dependencies & area of interest (i.e. UserGeoCodingService), or just area of interest (MappingService) with extra dependencies?

Thanks so much for your insight!

James

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:43:26+00:00Added an answer on May 11, 2026 at 8:43 pm

    IMHO, DDD is all about the MODEL, and expressing how the domain experts say things work. I don’t really know much about this domain, so I can’t point out for sure what makes more sense. You will need an expert or a consistent model to base on. If you don’t have a model yet, just stop coding now, and go build your model.

    First, you need an ubiquitous language to help you have a better insight, creating the classes accordingly. Does the separation based on area of interest only makes more sense for the domain experts?

    How do domain experts explain the process? Do they use terms like AddressGeoCoder, TimeZoneCoder? If so, then it is a good design. Otherwise, you better get to know how they think.

    About the class, that has only one method that uses a repository and two coders, there are a few possible ideas (see or create one which makes sense FOR THE DOMAIN).

    • Only the method receive its dependencies from the parameters
    • Extract this method to some other class (like a service, as you said)
    • Summarize this 3 entities in only one (like GeoCodeUserData, again, if this makes sense for the domain)
    • Use a dependency injection framework to avoid extra work including these dependencies
    • Let your constructor accept nulls (and deal with errors the same way a domain expert say it should be done)
    • Whatever idea you else have, validated by a domain expert

    DDD is an intense work of refactoring also, once you get better insight of the domain, so it’s good to have tests for stuff, so you won’t be afraid of making the necessary changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 163k
  • Answers 163k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Do you just need to add to this ordering? You… May 12, 2026 at 12:08 pm
  • Editorial Team
    Editorial Team added an answer For example - user goes to check the message and… May 12, 2026 at 12:08 pm
  • Editorial Team
    Editorial Team added an answer added "!" at the end: User.find_by_name "a" => return nil… May 12, 2026 at 12:08 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.