You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
"most of them have just one method" "This looks smelly even in statically checked, object oriented languages such as Java or C#" actually PHP, also in combination with phpDoc, has moved a lot towards "statically checked". This memo has not been received by all PHP developers yet. But it is the way I intend to use it.donquixote– donquixote2016-05-13 21:16:42 +00:00Commented May 13, 2016 at 21:16
-
"An interface and two classes for just a string? Seems like too much architecture and not much KISS.", "use a IAppConfiguration interface" - At least in one case, the string can come from a config container or from elsewhere. There is some conditional lookup logic going on. So the string itself is simple, but the way to retrieve it not so much.donquixote– donquixote2016-05-13 21:20:38 +00:00Commented May 13, 2016 at 21:20
-
"Lazy<T>" (or Lazy<string>): In PHP this would mean adding a "callable" parameter to the constructor. This works, but it is not as self-explaining as an interface, and also not type-checked. If you have multiple such parameters, it is easy to inject the wrong callback in the wrong parameter.donquixote– donquixote2016-05-13 21:26:20 +00:00Commented May 13, 2016 at 21:26
-
"Inject information just-in-time" This makes the object mutable, which is often undesirable. It is like the toaster that starts out at level 2, then one user sets it to level 5, and the next user has burnt toast. Also, currently some usage contexts expect that the component can retrieve this information by itself.donquixote– donquixote2016-05-13 21:29:37 +00:00Commented May 13, 2016 at 21:29
-
"DAL shouldn't even know anything about the aspect of application configuration or even application per se." yes this was also my thought, yet another reason i did not want to pass a IAppConfiguration object. In this case, the component is not meant to be used outside the application, but it feels cleaner if it does not have to know where the info comes from.donquixote– donquixote2016-05-13 21:34:20 +00:00Commented May 13, 2016 at 21:34
|
Show 3 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you