Tsaukpaetra's Injection Dependency
-
@Zecc said in Tsaukpaetra's Injection Dependency:
If there are parts of the codebase you don't imagine will ever change,
... you can be certain those parts will be completely rewritten multiple times.
-
@dkf said in Tsaukpaetra's Injection Dependency:
it's very strict on what is visible and what isn't.
Java 9 module system seems to have been influenced in this direction, but the stricture is optional there. OSGI DS also discourages other assumptions about implementation objects, like lifespan and class name visibility and such. Wholesome fun for the whole family, and good for you, too!
-
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
The "example skeleton" app has millions of tiny classes that magically get shit like database instances and response instances transformation instances and what the fuck happened to a consistent and simple flow of logic?!?
"Convention over configuration" or something. See, it was all too easy when people could have an exception stop their debugger and give a helpful stacktrace, now the best practice is to instead have an IoC binding exception on failing to load the appropriate type because you didn't properly decorate or declare your implementation of
ICocksucker<BritishBroadcastingCorporation>
and the IoC framework shit itself.
-
@Zecc said in Tsaukpaetra's Injection Dependency:
ORM (doesn't matter which; it shouldn't matter which, so I can change my mind later)
Changing ORMs or changing databases is never that simple. It's like trying to port a game written against one engine to a completely different one. For all intensive porpoises, unless you make the change early enough, you are married to that technology likely for the lifespan of the application.
The other option is to inject so many layers of abstraction that you can change any dependent framework on a whim*, but then your application takes twice or ten times as much effort (which your competitors are not expending), and it's a gross violation of YAGNI (which overzealous use of IoC/DI is).
@Zecc said in Tsaukpaetra's Injection Dependency:
You just need to find the sweet spot.
Indeed. If I have to change 20 files to add one column to one grid on one page, someone done screwed up somewhere.
*Hey guys, you know how right now we're on ASP.NET MVC and SQL Server? Next month we need to be on LAMP. Haven't decided what we'll do next month yet - maybe Oracle and ASP.NET Webforms?
-
Yeah. I think I'm going to try keeping it as smiled simple as possible. Make a template class for the Action that does the general thing of call the database function after validating session and permissions, responding via JSON, and then after that class for the things that might need more special things.
The only thing else that might be being injection is the custom database thingy.
In effect, reducing boilerplate code into one template so the end result is just mapping routes to db calls.
We'll see tomorrow if I don't get roped into something as usual...
-
@Groaner said in Tsaukpaetra's Injection Dependency:
See, it was all too easy when people could have a
n exception stop their debugger and give a helpful stacktracecompiler error, now the best practice is to instead have an IoC binding exception on failing to load the appropriate typeThere's no better way to make sure everything fits together than make fitting together mandatory at language level.
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
We'll see tomorrow if I don't get roped into something as usual...
Off to an excellent start...
It definitely exists...
So... IDHACWTFIGO
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
IDHACWTFIGO
I've surprised myself, how I was able to read that.
Unfortunately (for you that is) I haven't done PHP in many years, so I don't think I call help you. I don't even remember if including ContainerFactory.php in index.php is a required thing or if there are resolution rules for that kind of thing.
There's at least one other person here who works with PHP, so they might be able to help.
-
@Zecc said in Tsaukpaetra's Injection Dependency:
resolution rules
This. I fuckled with some paths and am making progress. Now it says I'm declaring things twice!
Which is entirely possible as I'm bastadizing the template and trying to shove (piece by piece) the current code in the theoretical places that they should be.
-
Status: Progress! I got the default HTML error page to show up!
Holy fuck is that completely unhelpful.
I know exactly where and what is wrong, but nothing about this screen is even close to where the actual issue is!
I'm going to be quite angry with this, aren't I?
-
@Groaner said in Tsaukpaetra's Injection Dependency:
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
The "example skeleton" app has millions of tiny classes that magically get shit like database instances and response instances transformation instances and what the fuck happened to a consistent and simple flow of logic?!?
"Convention over configuration" or something. See, it was all too easy when people could have an exception stop their debugger and give a helpful stacktrace, now the best practice is to instead have an IoC binding exception on failing to load the appropriate type because you didn't properly decorate or declare your implementation of
ICocksucker<BritishBroadcastingCorporation>
and the IoC framework shit itself.Have a cookie.
-
@Zecc said in Tsaukpaetra's Injection Dependency:
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
IDHACWTFIGO
I've surprised myself, how I was able to read that.
YTYBSTMTOWTDWTF?
-
@kazitor said in Tsaukpaetra's Injection Dependency:
@Zecc said in Tsaukpaetra's Injection Dependency:
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
IDHACWTFIGO
I've surprised myself, how I was able to read that.
YTYBSTMTOWTDWTF?
Maybe! But the real question is: Should that make for fearful, or rapture?
-
@Tsaukpaetra Yes.
-
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
I'm going to be quite angry with this, aren't I?
Alright, got the logger a bit more fucked but at least it does a 404 when appropriate.
And in theory the database should be injectable. We'll see tomorrow when I start actually attempting to make a route that works.
We'll also see what happens when I request data from a table that doesn't exist. In theory it should just create it on demand, with a default entry for certain types that have templates, but that functionality is nowhere near completion.
I expect immediate success.
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
I expect immediate success.
-
-
-
@Tsaukpaetra and you’re using Slim, imagine if you were using Laravel whose typical “shit I dun fucked up” traces are double the length of that.
-
I Know For A Fact I Have
-
@Tsaukpaetra looks like a notation issue. Or perhaps an issue with the notated. Far from completely opaque, this is transparently revealing many points of opacity.
-
@Zecc said in Tsaukpaetra's Injection Dependency:
There's at least one other person here who works with PHP, so they might be able to help.
If they can't help, there's at least one other person not here who works with PHP.
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
I expect immediate success.
There is some success!
That only took fixing some mis-spellings, some manual "Hey this function is a core function, but I need to put a slash in front of it for raisins" errors, but other than that it worked the first time!
-
@HardwareGeek said in Tsaukpaetra's Injection Dependency:
@Tsaukpaetra Yes.
Now that he's got the Terror interface distinguished from Horror, we should be able to swap implementations of either one freely, thanks!
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
other than that it worked the first time!
Status: Creating CRUD actions for all the tables.
Still need to get tokens/authentication going at some point, but for now it's all the baby steps...
-
This might be a tangential topic, but: does anyone have any idea why did the PHP community decided to copy the Enterprise Java ecosystem? I mean, one can learn by mistakes made by others, but not by repeating them!
-
@Kamil-Podlesak some of us don’t. But Symfony and Zend definitely tried to appeal to that end of the market even if Laravel doesn’t.
-
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
does anyone have any idea why did the PHP community decided to copy the Enterprise Java ecosystem?
They realized the problem was that when Java tried it it had language support. Without any actual rules, total success.
Coming soon, the ima/BIGBOY asymmetric multiprocessing framework for PHP...
-
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
This might be a tangential topic, but: does anyone have any idea why did the PHP community decided to copy the Enterprise Java ecosystem? I mean, one can learn by mistakes made by others, but not by repeating them!
Because python did it?
-
Well, Python pip came after npm, as did Composer, but PHP’s gradual trend towards Java-like all the things started in 2007 or so with Zend Framewoek being “enterprise” (and esp. Zend Framework 2)
But you have things like Symfony adopting all the “make everything proper OOP so everything can be DI’d and replaceable and all the good stuff”.
-
@Carnage said in Tsaukpaetra's Injection Dependency:
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
This might be a tangential topic, but: does anyone have any idea why did the PHP community decided to copy the Enterprise Java ecosystem? I mean, one can learn by mistakes made by others, but not by repeating them!
Because python did it?
Did it? AFAIK most of the python ecosystem is inspired by Ruby and maybe perl.
Also, the language itself was not polluted.
-
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
AFAIK most of the python ecosystem is inspired by Ruby and maybe perl.
It depends on which part you look at. I'm told that numpy is very strongly influenced by Fortran, for example.
-
@dkf said in Tsaukpaetra's Injection Dependency:
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
AFAIK most of the python ecosystem is inspired by Ruby and maybe perl.
It depends on which part you look at. I'm told that numpy is very strongly influenced by Fortran, for example.
-
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
@dkf said in Tsaukpaetra's Injection Dependency:
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
AFAIK most of the python ecosystem is inspired by Ruby and maybe perl.
It depends on which part you look at. I'm told that numpy is very strongly influenced by Fortran, for example.
Well yeah. To stop re-using FORTRAN for math, we'd need math students to survive getting those maths and getting a better language without falling in a theoryhole and getting lost in academia forever. And the theoryholes only get deeper. There are some dangerously interesting things in them by now.
-
FORTRAN? Bad programmers can write Javascript in any language.
-
@Zerosquare Idea for new framework: fortran.js
-
You've been -ed.
-
@Zerosquare Life (and npm) is beyond parody at this point.
-
-
@Benjamin-Hall said in Tsaukpaetra's Injection Dependency:
@Zerosquare Life (and npm) is beyond parody at this point.
Rule 34: If it exists, or can be imagined, there is and internet porn and npm package of it.
-
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
Rule 34: If it exists, or can be imagined, there is and internet porn and npm package of it.
I guess that means there's porn of npm packaging mechanisms, but I don't want to think of it. The Cthulhu mythos is much less sanity straining.
-
@dkf said in Tsaukpaetra's Injection Dependency:
@Kamil-Podlesak said in Tsaukpaetra's Injection Dependency:
Rule 34: If it exists, or can be imagined, there is and internet porn and npm package of it.
I guess that means there's porn of npm packaging mechanisms, but I don't want to think of it. The Cthulhu mythos is much less sanity straining.
Oh, you got it wrong: npm packaing mechanisms are porn. You just have to be into some specific kink to like it.
-
Sorry. I'm OK with "no kink-shaming", but I draw the line at "no Node-shaming".
-
Status: Motherfucker!
Yes, I know that's where it's supposed to be declared! Where the fuck do you think it's trying to be declared again? Because, you know, that's where the problem is....
-
@Tsaukpaetra check you don’t have a use statement in that file whose last segment is EventInfo. You may have to alias it.
-
@Tsaukpaetra Isn't that the place where it's being declared again?
Are you including the same file twice?
-
@PleegWat said in Tsaukpaetra's Injection Dependency:
@Tsaukpaetra Isn't that the place where it's being declared again?
Are you including the same file twice?
I'm not including it at all, that's the dependency injector's job and the whole point!
@Arantor said in Tsaukpaetra's Injection Dependency:
@Tsaukpaetra check you don’t have a use statement in that file whose last segment is EventInfo. You may have to alias it.
Maybe. The action has the same name as the model but different case and in a different namespace. Will check it.
-
@Tsaukpaetra said in Tsaukpaetra's Injection Dependency:
Will check it.
Yeah, that seems to have been in. Who'da thunkit case sensitivity is a thing everywhere it shouldn't matter but isn't where it should?