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

  • SEARCH
  • Home
  • 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 6050331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:40:35+00:00 2026-05-23T07:40:35+00:00

When writing object-oriented software, I use dependency injection a lot: to compose together high-level

  • 0

When writing object-oriented software, I use dependency injection a lot:

  • to compose together high-level functionality from lower-level capabilities: my account management service uses repositories and validation services rather than implementing them itself.

  • to isolate components from their dependencies: my account management service uses its dependencies through interfaces, so that I can swap implementations, mock for unit testing and so on.

What patterns exist in functional programming languages to achieve these goals?

edit: a commenter rightly asks: “what about just passing round functions?”. I think that the following comment about function grouping hits the nail on the head – a service is a collection of functions with a shared set of dependencies that I can handle as an atomic group.

In Clojure it seems like protocols solve this nicely, but I was really wondering how the problem is solved more generally…

  • 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-23T07:40:35+00:00Added an answer on May 23, 2026 at 7:40 am

    At the small scale, things like currying and functions-as-parameters cut down the need for module dependencies. At a larger scale, things like Standard ML functors are very useful for this purpose. Racket has a system called units that does a good job on this too.

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

Sidebar

Related Questions

I'm a PHPer, and am not writing object-oriented code. What are the advantages of
I understand object oriented programming, and have been writing OO programs for a long
After writing code to populate textboxes from an object, such as: txtFirstName.Text = customer.FirstName;
We have a .NET object that does a lot of reading/writing with the database.
I am trying to get used to writing object oriented, but often I get
What are the pros and cons of each type/approach in writing Object Oriented scripts?
I am writing an object oriented program whose business process calls for a ticket
I'm currently enjoying the transition from an object oriented language to a functional language.
I'm writing a javascript function where I get a ul object from my HTML
Is this statement true?? Writing object oriented code, even in non-object oriented language. Can

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.