« first day (896 days earlier)      last day (4046 days later) » 

2:00 PM
so , what makes you think that professionals do not have bad habits ?
3
 
@metal_fan how so? a large portion of the ZF1 docs are the ZF2 docs. It's not like they have rewritten all the stuff from scratch. Not that I had a problem with ZF1 docs. But a lot of people did.
 
well, its the definition itself - "professionalism"
@Gordon Yeah they have not been rewritten, but significantly improved
that's the point
 
just throw it out here: i dislike ZF
 
@tereško yeah ZF1 suffers from global state and include_path...but... have you tried zf2?
 
@metal_fan i have not tried it , but i followed it along while they were still developing it
 
2:05 PM
@tereško random fun fact: you get fined if you do that in Germany
 
the change that you perceive is not as large as you would think. ZF2-rc3 still had all he global variables intact. The removal of global state was only on the surface level.
 
@tereško oh yeah.. by the way, they define MVC as a layer. If so a model can not be said layer, but a sub-one: framework.zend.com/manual/2.0/en/modules/zend.mvc.intro.html
 
@Gordon , I think you can get fined for that in all countries where they have paved sidewalks
 
@tereško it's not just sidewalks here. It's urinating in public that gets you between 20 and 100 Euros
 
@Gordon the condition was aimed to indicate level of development in the country
 
2:08 PM
hm surface? According to their docs they're following SOLID, DI now
 
*DiC
 
DI !== DIC
 
yeah I know
It was a typo, so that I fixed it
:)
DiC is better than passing around several objects
 
have not spent any time in browsing the source of final release
 
2:10 PM
@metal_fan We (me and @tereško) had (heated) arguments about how to define MV* before. Matter of fact is, I think it's more of a semantics argument than much else. Then again, he probably disagrees and I think that's ok. As much as I probably made him angry when we talked about hat, I still think it was a constructive argument.
 
@metal_fan ... that description would indicate there it is only called "DIC" , while it is implemented as simple service located/god object
 
@metal_fan Also, saying you 'follow SOLID' or you use DI doesn't mean they actually do :P
 
DIC are sexist. I will take pictures of everyone who says "fork the DIC" and upload them to the interwebs. And dont you dare to add dongles to it.
 
@Gordon DIC = DI container? If so, I thought they were called IoC container, if they're not the same, what's the difference?
 
@BenjaminGruenbaum That's the human nature :)
 
2:14 PM
@BenjaminGruenbaum might not fully answer your question but martinfowler.com/articles/injection.html
 
I love Martin Fowler ^_^
@Gordon that doesn't say what DIC is though (or mention it any-where), when you say DIC do you mean IoC container?
 
@BenjaminGruenbaum and yes DIC === DI Container === IoC Container. at least in my book
 
/me agrees with Gordon on this one
 
Anonymous
I got my neck sucked by a question vampire today for nearly 3 hours, for a freaking upvote. This is too much
 
2:35 PM
just ignore them and watch them put terrible questions on forums
 
@phpNoOb I usually delete my answer when I get dragged into that sort of thing.
 
@BenjaminGruenbaum ZF2 really follows SOLID (I've spent several weeks exploring it) and does good use of Di
www.youtube.com/watch?v=FjeMDvCdrtc
 
^^ Dependency Injection
 
@metal_fan That might be, I haven't done anything that's over 40 lines of code in PHP since 2010. All I said is that just because some framework says they follow X doesn't mean they do. DI and SOLID should be really easy and nice to follow in PHP than in languages like Java anyway since it's a dynamic language, at least that's the situation in JavaScript (well, except for Liskov substitution for obvious reasons, since it is not required to begin with)
 
you sure you got the right user ?
 
2:41 PM
Was that aimed at me?
 
it was aimed at the room, re-inforcing DI != DIC
 
mkey
did the north korea declare war today ?!
 
ok, I'm off, later
@tereško yes
 
well .. fuck
 
this world is going to hell in a handbasket.
 
2:45 PM
@tereško oh, on whom?
 
South Korea and any of its Allies that try to step in or they feel aren't on their side
 
@NikiC on USA, viewing south korea as USA's proxy
 
They can stay away from Japan while I'm on vacations there!
 
Works for me... (or was it fixed?)
 
Here's the declaration: mirror.co.uk/news/world-news/…
 
2:49 PM
> and threatened to "dissolve" the United States.
I lolled
 
> No force on earth can break the will of the service personnel and people of the DPRK all out in the just great war for national reunification and of all other Koreans and overpower their might.
 
@MadaraUchiha it was fixed .. i suspect that there was a DB issue .. it was glitching before the outage
 
hi
 
Uby
omg...
North Korea really declared war??
 
@Uby Yeah they are currently training people to try to throw rocks to the US
 
2:51 PM
.. gonna go an check what BBC and RT is saying about it
 
That's true. Because nobody can reason with crazy. The US defeated the Japaneese in WW2 because their leaders at the top were in the end reasonable and saw that the inevitable was bad for them. Not saying the US was good in that, not in the least, but at least the war was ended with diplomacy...
This I fear only has one ending...
but later all
 
Uby
@ircmaxell Japan surrendered with diplomacy?
 
oO
 
yes
they were put in a position where they could have continued the war, and lost FAR more. Or surrender and save the rest of their people... They made a choice to surrender when it was shown the lengths their enemy was going to go to. (The US was very bad in that respect, not arguing that, but still). They surrendered rather than going to the last person...
 
Uby
didn't they surrender after 2 atomic bombs were released on Hiroshima and Nagasaki?
@ircmaxell Aw, ok, now i got it
 
2:54 PM
@Uby actually the talks had begun before that =/
 
@Uby DIPLOMACY IN YO FACE BIATCH!
:-)
 
making the drop of two a-bombs one of the worst things taht USA did in WW2
 
Please please please stop rolling out your own password hashing method. Use the native API when you are on PHP 5.5. Or the compatibility library when on 5.3.7+ — PeeHaa 9 mins ago
 
@tereško absolutely
 
Uby
2:56 PM
@tereško it was a bad call
 
the drop of first bomb was a bad call
the drop of second one was a crime against humanity
 
Uby
@tereško I was trying to be ironic :P
I guess no one of people who took that decision were actually aware of the conseguences
they thought they were dealing with a stronger bomb
 
bullshit
 
Uby
but maybe I'm just saying BS
lol
 
I think the US thought Japan was on the verge of completing their own WMD and they wanted to take pre-emptive action. Also, I agree that the second bomb was a crime against humanity. I think no-one doubts that today.
 
Uby
2:59 PM
yeah, I just have a bare knowledge of the topic, I better shut up :P
 
While(!$php){sleep;}
 
@PeeHaa you are aware that NK has nukes, right? even if they cannot reach the US it doesn't mean they won't use them against SK.
 
@Gordon bbc.co.uk/news/world-asia-21979127 scroll to the bottom for a map
 
@Gordon They will be one big parking lot even before they start to aim them at SK
 
Does anyone know, are there any plans regarding mb functions? I've heard, that sometime ago there were talks about merging them with current none-mb functions.
 
3:03 PM
@tereško ok, they can reach Alaska but that's not an issue. Sarah Palin will just put on her Superwoman shirt and intercept them
 
... ww2... so far. But we have still problems with territories with Japan.
 
@Eugene There was one single option in php.ini mb.func_overload = 7
 
also .. i kinda suspect, that if SK start waving nukes around, China might just stomp on them. They have vested interest in avoiding nuclear conflict in the region
 
I am using string functions for binary data.
 
@sectus you have problems with territories everywhere
 
3:07 PM
@PeeHaa I think or rather I hope the whole declaration is just war rhetoric like all the years before. NK seemsa lot like they live 1984 there, so Kim just had to declare war against "the enemy" and then they will have some propaganda and in the end they won and everyone will have chocolate. But the Kim is the new Kim and we have yet to see how crazy he is.
 
@tereško , not much afaik...
 
@sectus en.wikipedia.org/wiki/Kaliningrad_Oblast .. something closer to my home
 
@tereško , do you doubt that this is part of Russia?
 
that's not the point i was trying to make
it is another "problematic territory" for russia
it should just declare independence .. but of course it cannot, for 100 different reasons
 
@tereško , not like with Japan.
 
3:12 PM
with japan you have a pissing contest over some tiny islands .. with Kaliningrad it's more like "well this sucks, and nobody knows what to do with it"
i guess originally Kuril had a value as strategical position , but I suspect that now it has become a matter of pride for both sides
 
@tereško , it's true.
 
@tereško , but a few years ago it was harder. People talked about invasion from Japan or other military conflict.
@tereško , we are still in war state with J de-facto.
 
Ken Thompson, creator of C, asked to take a C test http://ow.ly/jAEeV via @lemire
2
 
from ww2.
 
3:24 PM
@igorw :D
 
@igorw Didn't he die?
 
@sectus wasn't that around election time ?
 
@tereško , in Japan may be.
 
@MadaraUchiha no, you're probably referring to dennis ritchie
 
3:29 PM
@sectus @tereško please move the territory discussion to a different room
 
naah .. it was ready winding down
 
@tereško , true
we are all brother and, sometimes, sisters.
 
LOL
Until s/he annoys you :)
but that's just a stereotype :)
 
@metal_fan you must be the only child
 
@metal_fan sorry, had to edit that. I cant stand repetition ;)
 
3:35 PM
@tereško he didn't imply sisters and brothers, but humans in general
 
and i was implying that "annoying" is the default state of a sibling
 
well, from your point of view
 
@Gordon MODERATOR ABUSE!
Imma post on meta!
 
@MadaraUchiha go ahead. I dont read Meta :P
 
-2
Q: My sql code returns 7 rows in mysql. However when I retrieve it in php, it returns a single row. How to retrieve all data in php that sql gives

user2227387I am a beginner and following is my sql code. select temp1.service_number,temp1.serial_number, temp1.start_datetime, temp1.plate_number, text , temp1.staff_id from (select t.service_number,t.serial_number, start_datetime, plate_number, staff_id from trip t where t.staff_id = 3685 and start_datet...

there are so many things wrong with this, lol
 
3:40 PM
I say powers put to a good use :D
 
@PeeHaa uhh, but there was nothing edited in that transcript Oo
 
ninjas with freaking lazers I tells ya
 
@tereško , where are you store that comment snippets?
 
0
Q: PHP Form passing values via URL

Stephan BotesI have a login page (local intranet so dont worry about the security issues). This page consists of the following form code : <form action="auth.php" method="get" class="blocklogin"> <tr> <td class="blocklogin" ><div align="left">Username:&nbsp; <input class="...

 
3:49 PM
@tereško , how much you have?
 
Would you guys agree that DI Container == Service Container?
 
~4 for SO and then some random saves for the unfinished post and even search terms
for example, one note contains only text: "Viking Birthday Dirge"
 
Yes, because Services are instances
 
@igorw no. SC is injected and then you pull the services.
 
@igorw , i have similar question...
 
3:51 PM
@Gordon so Service Locator == Service Container? Any references on that?
 
@igorw none. i just use the terms interchangeably
 
@StephanBotes , you have differet scripts in url and in form
 
@igorw They are two approaches to accomplish the same t ask, but service location is a different approach
@igorw Also, I think the Martin Fowler link @Gordon shared here covers that iirc
 
@BenjaminGruenbaum the fowler article has something about SL. it doesnt mention any SC (I am not even sure SC is a term).
 
@Gordon I've often seen DIC referred to as Service Container, but the name doesn't imply IoC
 
3:55 PM
@igorw well, I wouldn't mind for some definite reference on these either
 
@BenjaminGruenbaum I know the difference between DIC and Service Locator.
 
@igorw , i think that point in delegation Service Locator to other objects.
 
SL for me means: Registry you inject and pull out services
DIC to me means: Superfactory
 
@Gordon , yeah, objects know about SL, but don't know about his interface.
 
yes, SL is quite clearly defined. if a DIC allows you to inject itself into services it can become a SL based on context.
 
3:58 PM
@igorw yes, that's actually what I believed Pimple to be until you told me that's now how it should be used
 
SL is a misused/misimplemented DIC
2
 
hello pink kitty
 
meow
7
 
Aside from SLs effectively being globals, not being explicit about your dependencies can become very frustrating very fast. It produces bad APIs and introduces coupling problems.
 
4:03 PM
@Gordon I think you may be right about this. My google-fu only shows me symfony shite for "service container". Which is quite unfortunate, because I actually think the term is way more approachable than "DIC" or "IoC Container".
 
@Gordon oh hey I linked to a bunch of songs in my profile, you should check them out and see if you like any. I expect to see them on your playlist =oP
 
@BenjaminGruenbaum that is correct.
@crypticツ you dont even follow me on spotify so you cant see them :P
@igorw maybe the docs should just add that it's one of the other terms
 
Not to mention they also tend to violate the principle of least privilege more often than not.
 
@Gordon open.spotify.com/user/go_oh Well they better at least show up in your top tracks =o)
 
@crypticツ the only band I know from there is Aqua. I didnt know they released an album after, errrr, 2000 :)
 
4:07 PM
yeah, they got back together and released a new one. There is only really one good song. They changed their style from bubblegum dance to more hip-hop/pop
 
@crypticツ yeah. listening to it on YT atm. not as much fun as Barbie Girl
 
@Gordon it's docs hack day, I'll see what I can do.
@Gordon it does mention the "dependency injection container" synonym
 
@igorw then it's probably good enough and we are just a bunch of confused people ;)
@crypticツ not all of them are on spotify
 
@Gordon yeah some are kinda rare finds and can only be found on YT.
 
@crypticツ you should have grown up in the 90s in Europe. Lot's of Euro Dance for you to enjoy :D
@crypticツ anyway. I know have a Pink Kitty Radio playlist and judging from the tracks I tuned in on YT this will be hell to live through. But thanks for the suggestions :)
 
4:26 PM
Yeah I love Eurodance. At least other people can enjoy the playlist now =oP I know I have unique musical tastes.
 
@Gordon Do you like Scorpions?
 
@crypticツ one of my friends already listened to two songs of it :)
@metal_fan hell no
back in a bit
 
@Gordon lol... u like only pop/country then? :)
 
4:51 PM
0
Q: php register_shutdown_function usage

FrancescoI'm trying to handle fatal errors using register_shutdown_function. I want to show an error page when this function is invoked, something like this: ` register_shutdown_function('en795HandleShutdown'); ... function en795HandleShutdown() { echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 St...

lmfao, look at that guy's echos
 
5:18 PM
@metal_fan no. i also like pop and country but i dont limit myself to a particular genre any more. when i like it, i like it. bluesy guitars help though.
 
5:44 PM
@crypticツ its very plasticky but less icky than i thought in general
 
Hello phpeople
 
@dyelawn hi
 
6:00 PM
I'd like to contribute to the servicecontainer v. Servicelocator discussion
 
-1
Q: Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.(while selecting multiple columns)

Ritabrata Gautamam using apache 2.2.i have written this code when am trying to run it my browser is failing to run it ,it's showing This webpage is not available The connection to localhost was interrupted. Error 101 (net::ERR_CONNECTION_RESET): The connection was reset. following is my php code: <?php...

 
I don't know the differences in current practice, but these should be very different things
 
can anyone solve it..pleasw
please*
 
A container should hold things. A locator should find them.
 
6:08 PM
@sectus you still here?
 
Ritabrata Gautam: unrelated
 
@RitabrataGautam please do not flag your own question for moderator attention just because you didnt get an answer in two hours.
 
wow there just has to be some award for doing that
 
6:12 PM
@RitabrataGautam also, the question has nothing to do with PHP or MySql. Your Apache is misconfigured. I moved the question to webmasters.SE.
 
@peehaa "tooter of own horn" badge
 
I was more thinking something like "abuser of flags" or "impatient ***"
:-)
 
though i know time is precious for everyone...but i have to submit my code by tomorrow...and it's 23:44..that's why..i eagerly need a solution...sorry to disturb you guys..bye
 
Ritabrata Gautum: no prob, thank you come again
 
@RitabrataGautam it might also be a problem with your network setup. in any case: not a php problem
 
6:28 PM
Hey
Are some magento experts around?
I somehow think I have found a bug, but am not able to spot it in the codebase :)
 
@gordon why would ServiceLocator and ServiceContainer be interchangeable?
 
@dyelawn because ServiceContainer is not an established technical term and I interpreted it as ServiceThing. You could inteprete from the other end as well though
 
is there a proper way to ask a question here?
 
Hey guys...
 
6:34 PM
jrad: Just ask and hope for the best :)
 
Slang terms aren't established words, but people still use and understand them. Please discourage people from using those two terms interchangeably.
@benlevywebdesign hello there
 
Ok so I am redoing my form and this time I am putting a subject line in my form
 
if we can agree that the term was invented by symfony and that symfony has a "real" DI container (that can be abused as service locator, just like most DICs can), then service container == DIC
 
thanks @shredding. I'm testing a long polling example on a site I've developed. The server looks for an updated file change time and then echos back the json of the file to my ajax call. problem i'm running into is the sight will not open any other pages while that code is running on server. I have noticed I can make updates from a different browser but within the same browser I'm locked out. Is this on purpose?
 
the old way I did the subject when the viewer didn't type one was this $subject = "Ben, you have been contacted by " . $_POST['name'];
and now that I have a subject line I want to change it or maybe not
 
6:40 PM
@igorw fine, as long as everyone agrees not to use '*Locator' and '*Container' interchangeably
 
it's a bit annoying that people refer to "DI container" and "Service Locator" as if they were different constructs. in most cases they are in fact identical and whether or not it is a locator depends on how it is used. if you inject the container, it becomes a locator. does that mean that the container itself cannot be used as a true DI container? no, it doesn't.
sure, one could argue that a DIC should prevent you from injecting it. I disagree with that because a) in some specific cases for the sake of laziness you actually do want to inject it, and b) that's like saying "you cannot do OOP in a non-OO language". the specific constructs don't matter -- you can do OOP in C with function pointers if you want.
 
The constructs may be similar. The words mean entirely different things.
A container holds things. A locator finds them.
 
both Container and Locator are not quite accurate terms. but they're easier to use than LazyMemoizingServiceFactory
 
Where's @tereško where you need him?
 
6:53 PM
@dyelawn the Locator finds them in it's internal Container though
 
@dyelawn any ideas why after switching my form field text headings to be placeholder text my form validation doesn't work anymore
 
Teresko is exactly where I need him to be
 
It works when I am testing it in dreamweaver
 
@gordon ok, so those are two things acting in concert, not two things playing the same tole
Role*
@benlevywebdesign on mobile, can't look at code
 
6:59 PM
> The important difference between the two patterns is about how that implementation is provided to the application class. With service locator the application class asks for it explicitly by a message to the locator. With injection there is no explicit request, the service appears in the application class - hence the inversion of control.
@dyelawn note Fowler means DI as the other pattern. Not DIC. But it basically boils down to: is the Superfactory injected.
The implication on your architecture is what is important
 
@dyelawn do you think setting placeholders instead of having the form field text outside the field would make a difference
when I preview in dreamweaver it works but not when its live, so weird
 
@gordon I think we agree; different things. If we don't, then I'm right ;) family time, good talk all
 
438
Q: Why do I need an IoC container as opposed to straightforward DI code?

VadimI've been using Dependency Injection (DI) for a while, injecting either in a constructor, property, or method. I've never felt a need to use an Inversion of Control (IoC) container. However, the more I read, the more pressure I feel from the community to use an IoC container. I played with .NE...

does not really shed more light on the difference
@igorw you could ask @bashofmann what he thinks the difference is. He wrote the guice port for php
0
Q: IoC containers and service locator pattern

TheSilverBulletI am trying to get an understanding of Inversion of Control and the dos and donts of this. Of all the articles I read, there is one by Mark Seemann (which is widely linked to in SO) which strongly asks folks not to use the service locator pattern. Then somewhere along the way, I came across this...

do @NikiC or @ircmaxell have an opinion on the difference?
 
7:17 PM
@TheSilverBullet, The service locator pattern is indeed used for the initial Resolve call. The service locator pattern has to be used at least once. Generally, the call is buried in some infrastructure detail, away from normal business class code. It will depend on how the application is structured to decide how the whole thing starts. But it indeed has to start with a call to Resolve first. In the framework I use, I define a custom factory class that is called at the start of each Http request, it then starts things with a call to Resolve. None of my business code knows about the container. — Kelly Ethridge Dec 12 '12 at 21:37
this is my understanding
 
responding
 
7:34 PM
"Hey there, service container. My factory made this thing which does stuff. Would you hold it, please, and give it to the locator when he asks for it?"
"Hi service locator. I'd like to accomplish something. Will you please find the tools for the job, which might be in any number of service containers?"
 
I would say that a locator is a lazy registry.
 
8:01 PM
Sometimes I feel that if me being able to answer some SO PHP questions (like stackoverflow.com/questions/15722405/…) just means I read documentation better than other people. I wonder why some people won't open the manual... :(
 
@igorw I would say that a locator consults a registry to find the desired service
 
I also find it interesting that the PHP room has more discussions about core OOP concepts and theoretical programming concepts than any other room here, that's a really positive thing.
 
@dyelawn if you decompose it, sure. I'm mostly referring to the outside view of a locator, and the interface that it exposes.
 
@BenjaminGruenbaum Yup :-D
 
8:09 PM
@BenjaminGruenbaum I'd love to constantly talk about how much PHP sucks, but unfortunately that is already covered by all the other rooms.
 
90% php hate rooted in ignorance
 
I want to try "ContextualServiceContainer", where multiple service containers might exist within an app, and routes may or may not be tied to any number of these service containers. It will prevent loading an entire service container for something that only requires 2-3 services. Tell me why I'm dumb.
 
@igorw LOL, I'm not a fan of PHP myself, I think that is has many inconsistencies that a language shouldn't have and should have been fixed AGES ago, which is why I personally stopped using it. 5.3 and 5.4 do seem like big improvements. The fact that are a lot of developers here that vouch for the language and have a good understanding of it and presumably the alternatives means you think it's a good option. That's good
When doing web, I mostly do JavaScript. JS also had a long period (10 years) of hate. Didn't take it personally back then.
 
How anyone can prefer microsoft is beyond me
 
@dirt I'd argue that 90% of hate for any programming language is not having a sufficient understanding of that language.
@dirt You know, SO is coded in .NET, Jeff has a recent blog post about why he didn't use .NET for disclosure. Personally I think that C# is an extremely powerful language which has a lot of the right stuff in.
 
8:17 PM
It's true.
 
My main beef with ASP.NET is that it's not community driven. This means that the documentation is lacking. Also you have to work with visual studio. Deployment can become hell really fast and there are not nearly as many libraries.
 
Yay for C#.
 
I know its very powerfull but to complain about consistency in a lang then prefer ms technology is just the epidemy of human ignorance
 
@Gordon I agree with stackoverflow.com/a/871420/1348195 on 90% of cases
 
Dont trust ms nor do I plan on it lasting longer than php
 
8:20 PM
@dirt C# is very consistent within itself. I don't want to make this about a discussion about C#, if you'd like to discuss it you're welcome to do so in the C# room.
 
Im just saying every lang has its purpose dont hate
 
Framework wars is the problem with php
 
I don't hate :) I think php has some awesome features other languages should learn from
 
@dyelawn I doubt "loading the entire container" is expensive. And if it is, that just means your app should be broken down into separate services.
 
@MadaraUchiha what the hell did i miss now ?
 
8:25 PM
@tereško Discussion on DIC/SL
 
seems it's more like igorw trying to prove that he is right and everyone else here is wrong
kinda sad
again
 
@tereško sigh
 
service locator is not dependency injection container
service locator is what stupid people call a glorified registry
4
 
@tereško you seem to assume that the world is black and white and everything is either right or wrong. and you also seem to make unjustified assumptions about intent. suit yourself ;-)
 
dependency injection container does not produce the complete instances, service locator does ... from on you request the dependencies , from the other a complete instance
basically , read M. Folwer or GTFO
 
8:35 PM
@teresko it is usually not beneficial to trust the ideas and opinions of one person on intellectual pursuits
Or GTFO
 
@dyelawn It isn't one person, it's a very specific person who wrote a great article which is gained a consensus in the OOP community.
 
he just did not recognize the name ... (which is not an excuse, but a reason for an assessment)
 
@dyelawn Many colleges teach that article.
 
@BenjaminGruenbaum not as many as you would hope .. it's more like a master degree related subject
 
Also, IIRC Martin Fowler coined the term DI to begin with.
 
8:43 PM
i have realised that its pointless putting effort and detail into an answer as it is not appreciated and more than likely, isnt even read. From now on, everyone should just post short answers that contain the exact code required to not only solve the problem the question asks, but, implements a learning engine so that the asker doesnt ever have to do anything for themselves again.
 
I wonder if they reach anything else in that class?
 
@tereško let's go with martin fowler's injection article then. in his example he has a MovieLister that depends on a MovieFinder. does the container (be it PicoContainer or the Spring container) not produce a complete instance of the lister, with the finder injected?
 
emm ... so what ?
 
point being, at the top level you're going to have to get something out of the container. in this case it's the MovieLister.
 
They are specific implementation of the DI , not the DIC
 
8:45 PM
@bizzehdee You have to answer the right questions ;) Though as it stands now the right questions are very rare and hard to find
 
"dependency injection container does not produce the complete instances"
 
@dyelawn Of course, from my experience (in a particular university) it is only covered in 2-3 lessons (which is ~ 6 hours and a small project that takes 10-20 hours, patterns like DI are covered more in depth in more advanced classes.
 
@igorw yeah, I would like @tereško to elaborate on that too, I didn't quite get that part
 
So maybe we shouldn't just read that or GTFO. Maybe we should discuss concepts to improve upon existing paradigms.
 
@dyelawn see, there are certain truths that may not be questioned. basically read bible or GTFO ;-)
 
8:48 PM
the responsibility of a dependency injection container is to recognize and to provide the dependencies , no to create the object which has the dependencies
@igorw in that case i would have directed to GoF book .. no that he will recognize the acronym ..
 
@NikiC: wrote this answer earlier on for what i thought was "a right question" for that type of answer: stackoverflow.com/questions/15717753/…
 
user895378
I don't really care to get dragged into this topic for the umpteenth time, but I will note that the only people doing serious development I've encountered who argue that service locators aren't that bad are Symfony apologists. Is it coincidence that Symfony uses a SL? Probably not :)
 
@dyelawn tereško can be very rude sometimes but from my understanding he wanted you to read the basic material on the subject before having a discussion about it. Just like you wouldn't discuss the delicacies of preg_replace with someone who has isn't fluent in regular expressions.
 
user895378
Is SL bad? Not any worse than global. That's all SL is ... a way to access global state from anywhere. If you're okay with it, use a SL. Just know that it opens you up to all the problems that disciplined OOP is meant to avoid.
 
user895378
But it's not going to make your computer blow up.
 
8:51 PM
19 mins ago, by tereško
service locator is what stupid people call a glorified registry
 
@rdlowrey nobody is forcing you to inject that container. see also: every blog post about controllers as services, ever.
 
user895378
@igorw If you don't inject it, it's not a SL.
 
@rdlowrey While I completely agree about 'being practical' being the most important factor in a development environment, I was under the assumption this discussion was about theoretical OOP. While we all write less-than-perfect (to say the least) code, I think it's still constructive to discuss how code should be properly written.
 
@igorw see every blog post about active records as the models
... your point ?
 
@rdlowrey my point exactly.
 
8:52 PM
@tereško I'm not sure I follow. Can't a DIC recognize and provide the dependencies for the object that it creates? I always thought that the difference between a DIC and an SL is that a DIC pushes dependencies into somewhere, whereas with an SL that somewhere will pull the dependencies by itself
 
user895378
@igorw Mine too :)
 
@NikiC , imho, you are starting to step in the SRP territory there
 
@benjamin I have read it. I don't think his comment was even directed at me. My point is, he's not just rude, he's dangerously and boringly presumptuous
 
user895378
@NikiC I personally subscribe to your definition. If you can't use it to put your application together at the bootstrap phase, what good is it?
 
In any case, I can agree on the "service locator is what stupid people call a glorified registry" part. That much is true for certain :)
 
8:55 PM
@NikiC I agree that the direction of traffic (pushing in DI with IoC vs pulling in SL) is a big part of it.
 
@rdlowrey then maybe stop saying things like "Is it coincidence that Symfony uses a SL?" just because certain symfony users abuse the DIC doesn't mean it's not a DIC.
 
huh ?!
since when it's not SL ?
 
user895378
@igorw The last time I checked (it's been awhile) the SL was the symfony default.
 
the magical "injector" which you pass around everywhere is a service locator
or was that changed
 
@bizzehdee Hard to judge what the right ones are ^^ I usually try to go only for those questions that require very specific expertise that few others have, but are still of interest for a broader range of people
 
8:58 PM
It's. a. Container. It holds things. Like a shoe box, or a tupperware
 
@rdlowrey it is in the default controller stubs of generated bundles. You disable it by deleting two words: extends Controller.
 
user895378
Then Symfony uses a SL by default. Is what I said wrong?
 
@igorw I understand nothing of this, so I hope this isn't an entirely stupid question: If it is known to be bad, then why is it the default?
 

« first day (896 days earlier)      last day (4046 days later) »