« first day (1773 days earlier)      last day (3166 days later) » 

11:00 AM
My brain is on fire guys! :(
 
well I didn't say OOP I just said PDO ;D
 
@Jimbo can I use Aurex for a small project as it is?
 
I thought PDO was only OO
and mysqli had both procedural and OO
 
@Demorus you can use an object in procedural code
 
true
 
11:01 AM
@iroegbu Sure, it's just Silex + Auryn. Thing is, if anything needs updating in it, there's currently no upgrade path. I need help with that
So you can download it and use it and do your own upgrades to it to make it what you want
 
is this a good learning source? codingcage.com/2015/04/…
damn, I am really grateful to you guys for pushing me to the right direction before I end up at the dark side of the force
 
@Jimbo okay... If I end up using it and have any upgrades I'll show you.
 
@Demorus I guess it'll do
 
@iroegbu Yeah, can still submit PRs to Aurex though :-)
 
@NikiC Why is zend_strpprintf() defined in zend_exception.c/h?! … zend_exceptions.h isn't even included in the standard headers like php.h … so…?
 
11:03 AM
@Demorus my precessors here have produces loads of procedural code, it is a nightmare :D
 
@Demorus the PDO connection itself was made wrong there, but the rest seems fine
 
Wont it kind of harm me though if I skip learning mysqli stuff?
and turn to PDO instead
 
@Demorus I never used mysqli
 
I see
So it seems PDO is like the new thing?
 
@Demoros PDO is like 5 years old I assume (don't know exactly)
@Demorus the problem is that you find a lot of shitty resources on google and people still learn things wrong (I was one of them.. )
 
11:04 AM
@MarcelBurkhard which means that msql and mysqli extensions are outdated right?
 
@Demorus mysqli isnt outdated but it makes no sense using it IMO
 
Guys, I have a doubt.
 
@Demorus mysql however is deprecated and will be removed as of php 7
 
mysqli or mysql?
I think you mean mysql
 
11:07 AM
The guy here does not use prepared statements. Makes me wonder if the post is not bad quality codingcage.com/2015/04/…
 
I have two classes: ContactFormRepository and ContactForm. I also have a ContactFormController which contain methods that tell exactly what to do. i.e. it tells how to insert a ContactForm into the database by calling specific methods in the above mentioned two classes. However, including all logic in the Controller class would not be right. Yeah? Therefore, what should I do to separate logic in the Controller class? Logic such as validation checks, etc?
 
well if PDO are anything like children, then a ten year old one is better than a five year old one ... a ten year old one can make tea and do errands and the five year old spends a considerable amount of each day pretending he is an aeroplane, or spiderman ...
2
 
@Demorus he does?! $stmt = $this->db->prepare("INSERT INTO users(user_name,user_email,user_pass)
VALUES(:uname, :umail, :upass)");

$stmt->bindparam(":uname", $uname);
$stmt->bindparam(":umail", $umail);
$stmt->bindparam(":upass", $new_password);
 
Oh, ok I didnt see that
 
@JoeWatkins are you talking about Laravel now? :P
 
11:10 AM
@MarcelBurkhard how would you rate the tutorial from 1-10? from a novice or intermediate perspective
 
a 6 maybe, but only to get to know pdo, not for the actual registration system
 
@HassanAlthaf I personally make my own Validator objects and use them for validation. That may be helpful. You can define a component that uses the repository and form, basically an additional layer of abstraction
 
@Jimbo Validator objects as in a sort of a Class where you define the validation rules and it returns if it is valid or not, yeh?
@Jimbo And what can I call a component that uses the repository and form?
 
@MarcelBurkhard is PDO becoming more popular? I mean, do you think that mysqli will die out or there will be more jobs for PDO experts than mysqli?
 
@HassanAlthaf Not sure about the second question. First I have a ValidatorComposite that you add validators to with addValidator(Validator $validator). Each Validator has a validate method that throws an exception if data provided was invalid. For example, I have things like ArrayKeyExistsValidator and things like that. You add all your validators into one ValidatorComposite, call validate($data) on the composite, which loops around calling validate($data) on each individual
Validator, and you get an exception if the data wasn't okay. Just define an interface for Validator that states the validate method must exist and @throws ValidationException (top level validation exception, you can extend for specific types of validation exceptions) if the data wasn't okay
 
11:16 AM
While both PDO and MySQLi are quite fast, MySQLi performs insignificantly faster in benchmarks - ~2.5% for non-prepared statements, and ~6.5% for prepared ones. Still, the native MySQL extension is even faster than both of these.
 
@Demorus this is not an issue concerning jobs, It doesn't take much to learn using PDO/mysqli
@Demorus again: simply using PDO != Writing OOP Code
 
@MarcelBurkhard wikipedia states PDO is purely OOP
or maybe im a bit confused here
 
@Demorus that doesn't stop you from writing procedural code around it
 
Oh
Oh ok I get it now, ya.
 
@Demorus it takes some minutes to set up the database connection
 
11:19 AM
Is PDO safer than mysqli marcel?
 
@Demorus I guess not, depends on how you use it
@Demorus they both offer parameterized queries
 
So the only advantage over mysqli is database support?
oh and server side prepared statements
 
@Demorus well... no.. it is OOP :D
and someone said named parameters
 
oh ya true
 
@Jimbo If I throw an exception for Validation, would that be user friendly?
 
11:22 AM
So does a pro use MYSQLI or PDO? For example facebook, youtube etc
 
@HassanAlthaf It's for you, not the user. The dev could then just look for ValidationException and convert that to display a message to the user.
 
@Jimbo Oh, can you show me some sample code on how do I convert that to a message or something?
 
some guys comment: MySQLi is more powerful and probably more complex to learn. PDO is more elegant and has the advantage that you only need to learn one PHP API if you need to work with different DBMS in the future.
 
Hey guys. Anyone with ejabberd (XMPP) experience here?
 
@Jimbo Never mind, I figured it out. But is it possible to throw multiple exceptions of the same class at the same time?
 
11:30 AM
@HassanAlthaf You could implement that, for example in your ValidatorComposite::validate method you could catch the exceptions there and store them in an $exceptions[] array... then return the array of exception messages. Implementation is up to you :-)
 
@Jimbo I don't get it.
function lol($showError = false) {
    if ($showError) {
        throw new MyException("Showing error");
    }
}

try {
    lol(true);
    lol(true);
} catch (MyException $e) {
    $e->customFunction();
}
That is just a playground
But, I only get one Exception
Do I create multiple kinds of exceptions for each and everything?
 
An exception causes the code to stop at the that point. You will only see a single exception, control does not get passed back to the try block.
 
Oh.
So, how do I catch multiple exceptions?
 
74
Q: Catching multiple exception types in one catch block

Dominic GurtoI'd like a cleaner way to obtain the following functionality, to catch AError and BError in one block: try { /* something */ } catch( AError, BError $e ) { handler1( $e ) } catch( Exception $e ) { handler2( $e ) } Is there any way to do this? Or do I have to catch them separately? ...

 
@HassanAlthaf You don't, that's not how exceptions work, or generally what they are for. You throw exceptions when the code path cannot continue because e.g. there is bad user input or a database connection failed. It doesn't make sense to pass control back in to a try block, the only thing like that which might make sense (and this is rare) is a whole try/catch in a loop, where you might try again, but you start again from the top
However, you can do something like:
 
11:40 AM
@HassanAlthaf This is what I do for validation. Something like this (I haven't tested) - Edited to add catching your multiple exceptions
 
try {
    if ($var === 1) throw new IDontLikeTheNumberOneException("Ew, it's all straight");
    if ($var === 2) throw new IDontLikeTheNumberTwoException("I don't like swans either");
} catch (IDontLikeTheNumberOneException $e) {
    // handle the case where $var is 1
} catch (IDontLikeTheNumberTwoException $e) {
    // handle the case where $var is 2
}
 
oh.
@Jimbo That is a really nice one.
But, would you guys recommend me to use a library like this: github.com/Respect/Validation/blob/master/docs/VALIDATORS.md
Or do you guys recommend me to try that out myself from scratch?
 
Building backdoors via compiler/interpreter bugs: fascinating! http://goo.gl/Puvjn6
that one is quite cool :O
 
11:59 AM
askubuntu.com/questions/50344/… that should work with php7 too, right?
 
no, if you run php7 and php5 on the same machine, Nikita can come round your house and punch you in the neck ... read the small print ...
 
@JoeWatkins lol
 
hahahaha
My 16 y.o. brother is sending me his php code for the website of his Minecraft server
I need to subscribe to /r/eyebleach
 
@FlorianMargaine you can always use him as a boxing training sack
s/sack/sandbag
 
12:03 PM
posted on August 24, 2015 by kbironneau

/* by Femto */

 
Morning
 
mohaa
 
Guys, have anyone of you ever used Respect/Validation
 
@HassanAlthaf Give it a go, see if it fits what you're trying to validate...
 
It does what I want
But it doesnt seem to show any exceptions
neither deos i show messages
*does it
public function validateInput($data)
    {
        $usernameValidator = Validator::string()->noWhitespace()->length(3, 15);
        $var = '';

        try {
            $usernameValidator->validate($data);
        } catch (NestedValidationExceptionInterface $exception) {
            $var = $exception->getMainMessage();
        }

        return $var;
    }
Tried that, doesn't seem to work.
 
12:22 PM
@HassanAlthaf getMainMessage to getMessage
 
@VeeeneX Didnt work
 
Ok try vardump on it
and if it doesn't work problem is in scope
 
@VeeeneX string(0) ""
 
With getMainMessage ?
 
@PeeHaa o/
 
12:24 PM
@VeeeneX getMessage()
And main too.
 
Do it with getMainMessage because your're using Respect/V
 
Main gives same result
 
Nvm got it to work.
@VeeeneX Thanks, but cant I get all the messages at once?
 
12:29 PM
@HassanAlthaf var_dump($exception->findMessages(array('alnum', 'length', 'noWhitespace')));
 
yw
 
Can I customize message?
 
Yes, like this:
$this->return["data"]["messages"] = [
      array_filter(
            array_values($Exception->findMessages(
                array(
                    "name.notEmpty" => 'Názov nemôže byť prázdny',
                    "name.length" => 'Názov musí mať dĺžku od 5 do 80 znakov',
                    "name.charset" => 'Názov nemôže obsahovať hacky-baky',
                    "text.notEmpty" => 'Text musí byť dlhší ako 5 znakov',
                    "text.length" => 'Text musí byť dlhší ako 5 znakov',
And it is NestedValidationExceptionInterface
I got following function of sorting:
usort($products, function($a, $b) {
       return strcasecmp($a->label, $b->label);
});
 
hey guys, why write if (isset($_POST['name']) && isset($_POST['password'])) { instead of just
 
12:34 PM
And how to detect if 2 or more has been ordered?
 
isset($_POST['button'])
I guess because the button itself cant be posted
 
It can and it will
 
@ircmaxell kinda sad that you talk after laravel guy
 
@Demorus So when I do on your page just post button and then I don't fill name?
English failed ^
:D
 
@VeeneX you do fill in a name and password. However, what if there are more fields, then I would have to create more issets.
 
12:38 PM
@MarcelBurkhard why?
 
@Demorus foreach?
 
@VeeeneX Meaning "how do I check whether the position of two ro more items were altered?"
 
Morning guys
How do I get time from server so that even if user changes his/her computer time, the date or time would have no effect ?
 
@VeeeneX makes sense.
 
Currently I'm using getdate()
 
12:40 PM
@ircmaxell I can't take him seriously
 
I'm testing php code locally. Is that can be the cause that if I change the computer time, the time is also being changed ?.
 
@ZahidSaeed yes
 
@MarcelBurkhard if I make it online then will it be ok ?
I mean will it work correct automatically ?
 
@ZahidSaeed php code will use the server time, javascript code might use the browser time
 
@DaveRandom Yeah, now it sorts first column and if there are more than 2 same values then sort it by second column i.imgur.com/O0QOY2E.png as Excel does with selecting 2 columns and sorting it by alphabet
 
12:42 PM
@ZahidSaeed if you use a shared host they will probably have the correct timezone and time yes
 
Thanks
Got it !
@MarcelBurkhard But how do I get AM or PM from server ?
 
@DaveRandom If you have time, I just need to know how Excel algorithm for this works.
 
usort($products, function($a, $b) {
       $col1Sort = strcasecmp($a->label, $b->label);
       return $col1Sort ? $col1Sort : strcasecmp($a->col2, $b->col2);
});
@VeeeneX
It's pretty simple really... if sorting by the first column results in 0 (i.e. they are the same) then return the sort value of the second column. If the first column is different, just return that.
 
@DaveRandom I wish to have logic as you do. Thanks man, helped me a lot.
 
damn what am I doing wrong? why cant I use my connection variable and add it as a parameter for other functions? $connection = db_connect($connection);
connection is endefined even if it is within the function : /
Im doing this in order to prevent the use of "global"
 
12:53 PM
@Demorus what errors are you getting?
 
@Patrick variable is undefined
I might post my code
 
@Demorus $connection = db_connect($connection); this line? unless you defined $connection earlier, there is nothing to pass into db_connect yet...
 
@Patrick By the way. I just learned of $_SERVER["SCRIPT_FILENAME"]. Is there a way to get the url of $config = parse_ini_file('config.ini'); relative of the file it is included to?
 
I will check it out. That link looks great. I will read it. By the way, here is the code im working on. jsfiddle.net/6v6ueov5
You can see what I was trying to do there. I might as well use globals though xD
 
1:04 PM
you are using (super-)globals...
also why are you still using mysqli?
and this... $query = "SELECT id FROM members WHERE name = $name AND password = $password";
Please go read up on sql injection before you continue
Your current code is a hacker's dream
 
@Patrick im aware of prepared statements and all
It is just for trying out something on Xamp.
 
@Demorus then why are you open to sql injections?
 
@Patrick once I got the connection to my test server then I will integrate the rest but im not sure why I cant pass the connection from one function to another
 
function login_check($connection){}
login_check();
can you spot the error?
if not, go read up on functions again...
 
Greetings
 
1:08 PM
yes I can
or maybe not
 
@Demorus $query = "SELECT id FROM members WHERE name = $name AND password = $password";

[x] vulnerable to SQL Injection
 
I know
instead its with ?? placeholders
and then using OO prepared statements
 
@Abe this kind of change is always an incontestable BC, the surface is not important.
 
thing is I dont seem to understand how to use parameters
 
@Demorus prepared statements have nothing to do with OO
 
1:10 PM
PDO is not an OO interface, it's a procedural one implemented using classes
5
 
ya I know but in mysqli you have a procedural and OOP style
 
@Demorus you can also connect to more than just mysql via PDO
 
@Demorus there are like 20 experienced people telling you to use PDO instead and yet you insist on mysqli because it's "procedural and not OO"?
 
Its kind of hard
 
Anyone tried using PuPHPet in production? Wondering how robust their puppet configs are
 
1:13 PM
@Demorus It's hard because you don't listen...
 
@Patrick you are right
 
@Demorus just give a try to pdo and you feel better :D
 
Rule #1 in negotiating, @Patrick: make the other party feel like they're making the choices (when they aren't)
(It works about 70% of the time on management :p)
 
@Amelia I'll keep that in mind :D
 
1:26 PM
Is there a way to say better: "a personal invitation is coming your way" :D ( off topic )
 
@Patrick so here I read functions and no matter where I read about functions for newbies...it never tells you how to create a "read only" function parameter. The examples always show stuff that can be changed later by the user. For example func(x,y). calling func(10, -10)
 
@Demorus I'd stop using W3 Schools if I were you
 
In my case I just want to return my connection to the caller and
@Machevity same here http://php.net/manual/de/language.functions.php
 
I need to get the value of a parameter in a URL string. I can pass the URL to parse_str() and get the value. But the PHP docs don't show URLs being passed to that function, but just query strings. Would the correct way be to use parse_url() to get the query, and then pass the query string to parse_str() or does it really not matter?
 
What's wrong with $_GET?
 
1:35 PM
@crypticツ parse_str(parse_url($url, PHP_URL_QUERY))
 
@Demorus there are no read only function parameters. You can always overwrite the variable inside of the function (but it won't affect anything outside of it unless you passed it in as a reference, which you shouldn't).
 
1:48 PM
Does anybody know the author of https://code.google.com/p/cool-php-captcha or know how I can get in contact with him? #LongShot
It's a google code project so that owner may very well be dead by now, but who knows :)
 
May 2012, last updated.. so dont know.
 
@crypticツ what @PeeHaa says or you use the URL abstraction in the cvbacklog
 
you could click on his email address that is on the page @PeeHaa ?
 
That only takes me to his other projects
 
you can download it ;p
we also have option of "star this dev"
 
1:58 PM
@AnmolRaghuvanshi I know, but I need to get in actual contact with him
I have come as far as his blogger account with his not very useful and very common name which resulted in blogger.com/profile/11042521695514251708 but I doubt that is hom :)
Oh rdohms maybe found something
 
posted on August 24, 2015 by kbironneau

/* by Terra Prime */

 
lol!
Censorship in the US makes no sense. Female nipples are seen as explicit but Time can put a penis on their cover. https://twitter.com/realDonaldTrump/status/634378848516317184
 
@Danack thanks :)
 
@PeeHaa may be his last location..
 
2:10 PM
That doesn't look good. I think we will only find his body over there :P
 
haha.. may be he is travelling..
 
Is there a version of extract that works with dots in variable names as:
$values = [
    'value.with.dot' => 'blah',
];

extract($values);

if (!isset(${'value.with.dot'})) {
    echo "It's not set\n";
}
else {
    var_dump(${'value.with.dot'});
}
is annoying...
 
2:27 PM
You know the answer is stop using dots right?
:)
 
......
.......
 
@ircmaxell At least you are not using those annoying ellipsis @bwoebi always uses :P
 
that gives me a brilliant idea
 
@Danack does it not work at all or does it leave other traces? (See get_defined_vars())
 
2:30 PM
@PeeHaa ...?
 
… while real men just use ...
 
@bwoebi it's a restriction imposed in extract for no apparent reason by lxr.php.net/xref/PHP_TRUNK/ext/standard/array.c#1289
i.e. it just skips setting the var because it doesn't feel like setting it.
 
> Two Ashley Madison clients reported to have taken their lives after hackers published their details according to police in Canada.
 
@PeeHaa annoying???
 
@marcio Well if you cannot take it whenever it comes out you should probably not cheat :)
@bwoebi superannoying :D
 
2:34 PM
@PeeHaa why?
 
For one because they rather look like dirt on my screen instead of an actual character
 
@PeeHaa s/Well if you cannot take it whenever it comes out/
 
@PeeHaa what are the other ellipsis?
 
@bwoebi Because all the cool, non-annoying kids use only ASCII because ASCII Is Awesome And Does All The Things Languages
 
Also ^
@marcio Just use three dots...
 
2:36 PM
But alt+dot is faster to type than 3 dots
@PeeHaa fix your screen
 
@bwoebi ···
 
@bwoebi Writing a single message to continue this conversation has probably eliminated all the time you've saved over the years at a stroke
8
 
@PeeHaa well, they're dead now, so... judgments will not make any difference
 
@DaveRandom nah, main purpose is having discussions like this
 
:-P
 
2:40 PM
@DaveRandom that's like watching somebody spending hours on a micro optimization.
 
@bwoebi A mac does alt + dot?
 
@PeeHaa apparently it's alt+ semi-colon key on my mac to get …
 
nope, extract() doesn't allow rule violations
 
Morning.
 
o/ @LeviMorrison
 
2:47 PM
@bwoebi option + ; (for me on Mac)
 
Might depend on the keyboard layout...?
 
3v4l.org/0oFo6 why am I getting 6:0 and not 6:00? I'm using lowercase 'i' so it should be minutes with leading zeros which according to the date docs is 00-59. Does DateTime use a different format? I'm probably doing something silly. =o\
 
alt gr: … shift + alt gr: ÷
 
@bwoebi Probably – I'm using English Western layout.
 
@crypticツ I would recommend using the format function . Accessing the properties of DateTime directly is sometimes..... exciting.
 
2:56 PM
@crypticツ these properties are documented as integers...
 
@LeviMorrison swiss french here.
 
cc @crypticツ
the ->i property is an integer, so you would need to str_pad() it if you wanted to access it directly and get leading zeros
 
Thanks! I'll use format for both just in case the ->h also messes up some day.
 
off-topic: other than SO and Indeed, are there any other popular job boards for remote PHP jobs? :]
 
3:04 PM
Do you count contractor or freelancer stuff?
 
sure
I'm just burned out on recruiters ;P
 
@ScottArciszewski I have a pretty good one I can give you a referral to if you'd like. I've had a lot of friends find great success with it.
 
the biggest impediment I have with recruiters is that it generally doesn't make sense for them to represent me to clients
 
Ah shit @Andrea, mine and your talks are on at the same time and yours is so much more interesting. I might just sit in yours :P
 
@ScottArciszewski Oh, I didn't mean a referral to a recruiter :)
 
3:10 PM
oh
:P
 
I don't know how to do private chat on this thing
bleah
 
well my email address is scott@arciszewski.me if you'd rather email it ;)
 
user image
4
 
and thanks :)
 
@Jimbo hahaha
 
3:11 PM
I'm pleased to announce that I will be speaking at this year's @phpnwConf on Dependency Injection. Schedule: http://conference.phpnw.org.uk/phpnw15/schedule/ #php
4
 
@bwoebi yeah, that sounds weird. you should probably move them
 
@ScottArciszewski Alright, sent.
Cool thing about these guys too is that they also send you a check if you get hired.
 
@Jimbo congrats, and no pressure.
 
hmm I haven't gotten it and I don't see any errors in my postfix log :(
could you try scott@paragonie.com? it's hosted by google :)
 
@bwoebi Probably was made to format exception messages.
Then it never got moved.
 
3:24 PM
@ScottArciszewski Sure, no problem.
Let me know if you still don't get it. I can gchat the link
 
ThW
3:38 PM
@Jimbo, @Danack got a ticket ;-)
 
got it :)
 
aww, all the cool conferences are overseas. :-(
 
@ScottArciszewski Cool, let me know what you think of them. I have a friend that works over there and from what I hear it's been a pretty successful product so far. It's kinda of like a backwards job search, which was their key defferinitiator.
 
I was wondering if anyone would mind taking 2 seconds to read my answer (and if the case be, let me know I'm crazy and should delete it). I feel a bit rogue, so I wanted to make sure I'm not being ignorant when it comes to DDD approaches.
0
A: DDD - the rule that Entities can't access Repositories directly

prograhammerThis post is now 4 years old but I'd like to add a few things to this (still ongoing) debate. I find myself aligned with the idea that it is not wrong to make a repository call from within an entity when a special need arises for it. Yes, I do agree that in many cases we can remodel our aggregat...

 
@Danack Cheers buddy, if you wouldn't mind when I've done the slides would you spare 10 mins to go over them with me and make sure I'm putting forward the right message?
@ThW Awesome! What changed your mind, the ability to heckle / throw things at me on stage? I thought you weren't coming?
 
3:53 PM
@prograhammer insta-downvote :)
sorry
 
^ lol, what's wrong in my thinking?
 
ThW
@Jimbo I wasn't fast enough to get a ticket, but a coworker got one. He changed his mind - so now I got one.
 
@Ocramius you are actually the one I wanted to read it
 
> By making a repository call from an entity does not break our domain layer.
mostly this
 
Yeah, so it's a first class citizen right?
 
3:54 PM
an entity accessing a repository is pretty much a scope encapsulation breakage. Your single entry now knows how to get out to the world
this is what you'd solve in a domain service instead
anyway, back to work, sorry for the downvote
 
shall I update that part?
and that would get me in good standing on the post? or are there other issues?
 
The main issue is that overall it's wrong
it's not a rewording issue
it's just wrong
 
man, I really wish you had 2 minutes to elaborate for me, It would mean so much!
 
that's why you are given stuff like the specification pattern
build a specification from the entity, then pass it to the repository from the domain service
 
because I really felt good about this answer. I felt like I had a solid understanding of my DDD aproach and how it would work for me in my project.
 
3:56 PM
rather than allowing the entity to reach out to the storage where it came from
Yeah, this one shows a bit of confusion
 
Are you suggesting that a service will populate more stuff in the entity? I tend to think that a repository is a domain service.
I mean, a domain service should be responsible for filling in more parts (as opposed to lazy loading) or giving an entity some information (like unique'ness) from the repository?
 
Example:
public function mountYourFriends(MountFriendsCommand $mount) { // see store.steampowered.com/app/296470
    $user = $this->users->get($mount->userId());
    $friends = $this->users->findBySpecification($user->getFriendsSpecification());
    array_map([$user, 'mount'], $friends);
}
this is what a domain service would do
you can also simplify it to a command handler tbh, doesn't need to be segregated further
there, betr.
 
Ok, so a domain service should be called (by our application layer) to fill in parts of the entity. The domain service can use the repository in a direct way to help in an aggregate.
But what does this buy us?
What's the danger of an entity doing this for itself?
 
It would have global side-effects inside the aggregate
 
Can't entities access other Aggregate Roots from other aggregates?
 
4:03 PM
no
 
only if they are part of a larger aggregate
 
Can aggregate roots access other aggregate roots?
 
aggregates reference each other by ID and don't talk with each other
no, that would be a distributed transaction then
 
oh, right...transaction bounderies
but what if (assuming I've modeled my domain right) I need to use some behavior that is in another aggregate root?
Should that behavior be pulled out into just a regular old object. Or put into a domain service?
 
4:05 PM
Your other aggregate is either part of your current aggregate or it is completely separate
Otherwise you mix up contexts and it ends up in a mess :|
sorry, back to work, am in a mess of legacy code atm
 
So aggregates can only work with each other using events. Otherwise the application layer needs to call an aggregate and get something, then pass it to another aggregate. Right?
^ last question
@Ocramius
 
right, completely separate transactions and IDs only. If two aggregates depend too much on each other, then there is something fishy at language level
 
thanks @Ocramius ! sorry to bother you at work!
I owe you
 
added this chat reference to the response
 
yeah saw that, I'll try to edit the answer (with referring to your response) in attempt to save the answer.
 
4:12 PM
Hi ho
 
hey @chozilla o/
 
<3 they support markdown :D
 
4:36 PM
@Gordon thanks, awesome
 

« first day (1773 days earlier)      last day (3166 days later) »