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 7959947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:39:07+00:00 2026-06-04T04:39:07+00:00

Since I’m not a native English speaker I better make sure not to create

  • 0

Since I’m not a native English speaker I better make sure not to create an DSL that would sound awkward for others. A DI container emerged out of a project and I’m isolating it as a seperate project. I see other DI/IOC containers using syntax like bind(interface).to(class). I would use the following (pseudo-code):

given(interface).thenUse(class)
given(class).constructWith(id=5)
given(class).inject(observer).inMethod(addObserver)

Do these make sense or does it sound like a construction from someone who doesn’t grasp the some finer semantics of these words?

  • 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-06-04T04:39:08+00:00Added an answer on June 4, 2026 at 4:39 am

    I think your approach makes just as much sense as the examples from other DI projects.

    Few notes:

    1. bind/to is shorter to write than given/thenUse. This is not a problem in itself, but if you can achieve the same meaning with shorter names, there is not much reason to use the longer ones (in the given examples they both read the same)

    2. If there is an established name pattern for the same use then life will be easier (e.g. grasping the concept/meaning) for users who know the established pattern coming to your implementation, which will be a benefit.

      If you are after “converting” users of other similar libraries/tool to yours, using the smae naming convention lowers the barrier of entry for those users.

      If your implmentation is conceptually different is some ways, however, it might be better to use different names to emphasize the difference and reduce cognitive dissonance (between what is expected and what is happening).

      If you think (one of) the other naming patterns have a flaw in them that creates cognitive dissonance (between what the name implies and what it actually does), replacing it with a better naming scheme could mean more followers.

    3. While given(class).inject(param).inMethod(method) reads well in English, it has an order of objects that might be counterintuitive for someone (class/param/method as opposed to class/method/param, which is the natural order for OO languages: Class.method(param);); consider: given(class).and(method).useParam(param)

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

Sidebar

Related Questions

Since i'm not strong in asp.net, probably my question will sound silly. I've got
Since Rails is not multithreaded (yet), it seems like a threaded web framework would
Since I am not getting anywhere with my previous question , I would like
Since ColdFusion is itself Java-based, I would imagine it's not too much of a
Since Haskell's data are Immutable,how would you globally store a list that can be
Since hist() of the base R does not report percentages (and the freq=FALSE) does
Since yesterday suddenly my Eclipse does not work anymore. The error is Failed to
Since OpenGL ES 2.0 is not backward-compatible to OpenGL ES 1.x because of it's
Since recent runtimes in iOS, we are able to define properties that will generate
Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better,

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.