IRCloggy #auraphp 2014-05-27

Logs Search ←Prev date Next date→ Channels Documentation

Provider of IRC logs since 2005.
WARNING: As Freenode became unjoinable and lost all warnings in topics, we cannot log channels on Freenode anymore.

2014-05-27

brandonsavage left00:47
brandonsavage joined01:14
brandonsavage left01:27
brandonsavage joined01:27
brandonsavage left01:28
cordoval joined04:52
cordoval left05:31
DanBangWTFRajib joined06:26
rafi left06:45
rafi joined07:25
Burnsy joined07:56
DanBangWTFRajib left08:27
Burnsy left08:49
Burnsy joined09:11
Burnsy left09:46
brandonsavage joined11:31
RWhar_awayRWhar13:03
RWhar Having trouble with aura.session's lazy starting, reading a previously set value from a segment does not start the session (silently fails returning null). What am I missing?13:07
joelclermont left13:47
joelclermont joined13:49
harikt joined13:51
harikt left13:54
harikt joined14:06
harikt Good day to all14:12
brandonsavage left14:18
RWhar hi harikt14:36
harikt RWhar, hey :)14:36
seeing you for the first time iirc14:36
from which part of the world are you ?14:36
RWhar from UK14:36
harikt cool .14:36
nice to meet you.14:37
and using any aura components / framework14:37
RWhar relativly new aura fan, nice to meet you two14:37
harikt nods. Thanks14:37
RWhar I'm using quite a few (web, session, filter, router, di)14:38
harikt I may be a bit away from keyboard for a while.14:38
if you have any questions ping here. will check when I am back .14:38
oh nice to hear.14:38
and thank you.14:38
are you already in google groups ?14:38
RWhar I'm not yet...14:39
harikt do join. We have less mails14:39
so will not spam you.14:39
RWhar :) will do14:39
harikt Thanks14:39
back in a while14:40
RWhar cool14:40
I'm having some issues with aura session. After commiting some session vars, relying on laziness to start the session when properties are read is not working for me. If I manually start the session ($manager->start()) it seems the $_SESSION array is not loaded back into the segment, but the data is available directly through the super global.14:58
harikt hm.15:00
RWhar, could you please show some code ?15:00
RWhar sure15:01
brandonsavage joined15:01
pmjones joined15:17
RWhar harikt: It seems like lazyStarting isn't working for reading values. When started manually the session array as a whole is not populated unless a named variable is accessed first http://pastebin.com/bJVJ0zE915:19
ignore the "On a later request" section15:21
harikt I want to go for a while.15:28
pmjones, if you have some time please check RWhar having some issue with Session15:28
pmjones ah so15:28
hey harikt thanks man15:28
RWhar: what's the trouble?15:28
harikt pmjones, http://colabti.org/irclogger/irclogger_log/auraphp?date=2014-05-27#l4915:29
pmjones thanks again harikt :-)15:29
pmjones looks15:29
RWhar hi pmjones15:31
pmjones hey there RWhar15:31
i'm looking at your pasted code now15:31
sorry for the hassle15:31
RWhar no problem, thanks for the help.15:32
pmjones i'm trying to whittle it down a little15:32
RWhar I guess session isn't populated automatically as it requires a call to __get(). But I thought from the docs a read would start the session (but not create a new one).15:32
pmjones a read *should* start the session up, provided one exists15:33
RWhar by session isn't populated, I mean the segment.15:34
pmjones nods15:35
pmjones thanks for that15:35
still reading15:35
brandonsavage left15:37
pmjones i'm going to write up a local example script and see if it works properly15:37
will paste it in a bit15:37
thatnks for your patience RWhar15:37
RWhar thank you!15:37
pmjones (all the tests pass but they may not cover your case for some reason)15:37
simensen pmjones: are you around?15:42
pmjones simensen: i am!15:42
what's up?15:43
simensen pmjones: ok :)15:43
looking at ADR15:43
pmjones ah so15:43
simensen original article. someone is making me read it. ;)15:43
it was on my radar but sorta pushed up the stack if you will15:43
pmjones interested in your thoughts, including "this is wrong-headed"15:43
simensen (or down)15:43
pmjones heh15:43
simensen one thing i just got to was the first example of ADR action15:45
pmjones simensen: cool15:45
simensen the big thing at first is 'request' and where does it come from... i've sorta been thinking about that since opening it15:45
but, as it relates to the first example, the checking on method feels... i dont' know.15:45
pmjones RWhar: check this out http://pastebin.com/bN52xCtg15:46
simensen i had imagined that action was a 1:1 map between a specific URI and a method15:46
maybe it is discussed later15:46
pmjones RWhar: place it in your docroot and browse to it, changing the path to the "instance" script15:46
RWhar: note that the "increment" value keeps incrementing, even though we never do a read15:46
RWhar pmjones: thanks, will check now...15:47
pmjones RWhar: so either i don't get what the problem is (entirely possible!) or there's something else going on elsehwere in the code15:47
simensen: it *can* be a 1:1 map to method+uri15:47
but it doesn't dictate that15:47
simensen why not?15:48
pmjones different folks have different approaches?15:48
simensen: ^15:48
simensen i guess from my perspective, if you're saying that the big difference between ADR and "traditional MVC" is that with ADR the action has one job specifically, having a action perform different actions based on whether you are doign GET or POST doesn't feel as compelling15:50
pmjones nods15:51
simensen for example, i woudln't expect BlogCreateAction should do *anything* with a GET request because of its name. if it is not a post, it shoudl be an error condition15:51
pmjones i had not considered that people might try to use the pattern in that way15:51
i have an assumption, unstated, that a router will point to an action, and that hte router picks that action based on method+uri+whatever15:52
i can add further clarification that the action is intended to be a single thing, not a batch of stuff15:52
i thouht that the bit about "controller vs action" would cover that but apparently not15:53
thanks simensen15:53
what else you got?15:53
simensen where does request fit into the picture?15:53
pmjones as with MVC, PAC, et al, it doesn't15:53
you are not the first to ask about it, and i had it in a much earlier variation of the description15:54
none of the architectural patterns describe the "input" parts at all15:54
simensen do they talk about the response, though?15:55
pmjones i can rationalize the omission along the lines of "the front controller may not send the request to the underlying controller at all, opting for a different input object"15:55
simensen (i haven't studied them as much as you have)15:55
pmjones simensen: they frequently talk about the output, yes15:55
using words like "View" "Presentation" etc15:55
or "Presenter" (which is where "Responder" comes from)15:56
maybe it's because there's not really a "Request" layer in these systems15:57
there's a front controller layer, a domain layer, a presentation layer, etc etc15:57
harikt I am back guys15:58
pmjones RWhar: if you can present a stripped-down piece script that demonstrates the problem, or a pair of scripts (i can see where it might be good to have one for the initial and one for the followup), that might help diagnose the trouble15:59
welcome back harikt :-)15:59
harikt :)15:59
RWhar, the one thing I feel probably is regarding the DateTime .15:59
pmjones you are always such a great help here, man, i really appreciate your diligence and attention :-)15:59
harikt: ^15:59
harikt pmjones, I am always here to express my thanks to you. If I have learned something I am sure it is from aura and the php community.16:00
so if I can I will try to help.16:01
pmjones nods16:01
pmjones i just want to make sure you know that i recognize your good will :-)16:01
harikt Thank you Paul .16:02
:)16:02
simensen pmjones: a little bit of me wonders about mixing concerns at the domain layer16:02
pmjones ah so?16:03
harikt RWhar, I have the exact same example without the date time.16:03
It is working over here .16:03
simensen "Domain is the domain logic. It manipulates the domain, session, application, and environment data, modifying state and persistence as needed."16:03
RWhar pmjones: Using the script you provided, and a second which just instanciates the segment and echo's a var the problem is not present. The first difference in my code is I don't use the instance script.16:03
pmjones mmmm16:03
so, try this16:03
RWhar harikt: thanks, I will try removing the date stuff16:04
harikt just comment out and see.16:04
pmjones RWhar: instantiate a DI container on its own and add the session stuff to it16:04
simensen i think mostly the session stuff jumped out at me. maybe environment data.16:04
pmjones RWhar: then pull the session manager out of it16:04
RWhar: do that in place of the instance call at the top of the test script and see if it continues to work16:04
simensen: yeah, i get that16:04
brandonsavage joined16:05
simensen pmjones: all in all, i think it is a good start.16:05
pmjones the original MVC description doesn't mention things like that16:05
simensen: a good start is what i'd hoped for16:05
simensen: but even though MVC/PAC/MVVM don't mention them, there has to be some layer that deals with them16:05
simensen: do you get me on that one?16:06
simensen yes16:06
pmjones simensen: maybe the issue is of the name "domain" vs the name "model" ?16:06
i confess to liking "domain" better here, but maybe that's misguided16:07
simensen seems like it would be a better fit for action for those things. or even in the front controller / web handler / stuff on the input side that decides which action gets called16:07
pmjones certainly some of that work goes in other layers16:07
simensen "domain" is another one of those words that is overloaded. :-/16:07
pmjones s/goes/can go/16:07
yeah i hear you on overloaded16:07
i wonder if "data" would be enough there16:08
that seems too generic16:08
simensen i think when i'm reading this, i'm trying to figure out how it is majorly different than say hexagonal / ports and adapters / ebi.16:09
pmjones i mention that in the pattern comparisons16:09
you are on the github version, or my blog version?16:10
simensen blog version (original)16:10
pmjones nods16:10
pmjones it has had some substantial updates, but not substantial changes, here: var_dump($segment->increment);16:10
gagh16:10
here: https://github.com/pmjones/mvc-refinement16:10
simensen: e.g. https://github.com/pmjones/mvc-refinement#comparisons-to-other-patterns16:11
simensen is the expectation for ADR to always require the ation to actually invoke the response?16:12
or is that an implementation detail?16:12
harikt RWhar, if you have any trouble again, shoot to google groups.16:12
RWhar will do thanks harikt16:13
pmjones simensen: implementation detail; cf. the bullet points under https://github.com/pmjones/mvc-refinement#front-controller-omission16:13
RWhar it's definitly something to do with how I instantiate - added the DI stuff to the example script and the issue is recreated16:14
pmjones aha!16:15
RWhar: one moment16:15
RWhar: review the config/default.php file in the Aura.Session package16:16
(if you have not already)16:16
that should provide hints on how to set it up correctly16:16
wdna joined16:17
pmjones RWhar: i think you can ignore the $loader stuff in there16:17
harikt RWhar, I assume the problem is with the https://github.com/auraphp/Aura.Session/blob/develop/config/default.php#L2316:18
cordoval joined16:18
harikt pmjones, if I am correct the di is not having the $_COOKIE passed in the pastie16:18
RWhar correct16:18
pmjones harikt: wow, i wonder if it's that simple16:18
harikt also https://github.com/auraphp/Aura.Session/blob/develop/config/default.php#L3516:18
pmjones harikt: nice catch16:19
yes, each session segment needs to be tied back to the same manager16:19
RWhar yep, that's it. thanks guys :)16:19
cordoval left16:19
harikt RWhar, ctrl + c and ctrl + v https://github.com/auraphp/Aura.Session/blob/develop/config/default.php#L10-L3616:19
;)16:20
pmjones, so where are you with the adr16:20
pmjones harikt: "in the middle of it" :-/16:20
RWhar: man, it's always something simple16:20
there are just 1000 simple things to check16:20
in Session v2 we will totally need a factory method for that instead of an instance script16:21
harikt I like it pmjones16:21
and we already have for many other components16:21
pmjones all the little things you learn from other people actually using it16:22
yep16:22
harikt pmjones, I was having some thoughts.16:25
RWhar passing $_COOKIE to the manager in my app code was all that was needed, just in time for the end of play too! Thanks for making yourselves available harikt, pmjones much appreciated!16:25
pmjones harikt: yes?16:25
harikt In aura v2 we have webkernel responder, webkernel router, web kernel dispatcher classes (3)16:26
pmjones RWhar: you're very welcome16:26
harikt RWhar, thanks to pmjones for the presence before I leave.16:26
can't we make it into a single class itself.16:27
we just splitted is what I feel.16:27
may be the router and the dispatcher for the web can be in a single class itself.16:27
pmjones harikt: the idea is that the router and the dispatcher can be replaced separately16:28
RWharRWhar_away16:28
pmjones e.g. a different routing system that uses the existing dispatcher16:28
harikt pmjones, we have already type hinted. so I am not seeing a chance to replace the router16:29
pmjones mmm, then all we'd need is an interface to typehint against, and voila16:29
harikt yes that sounds good then.16:30
else what you think will not apply ;)16:30
by the way another thing is16:31
don't know whether I already talked about this16:31
create the response headers from the request headers .16:31
Aura\Web\ResponseSender->create() something like that.16:32
pmjones, what are your thoughts on creating headers for the response sender or response itself ?16:33
only in case if there is no headers.16:33
pmjones harikt: ah, idid see you mention that elsewhere16:34
i don't think that's a responsibility of the sender16:34
harikt probably over github commit16:34
may be response itself16:34
pmjones in MVC, that would be the responsibility of the Controller, and in ADR of the REsponder16:34
we don't want the response object "setting itself up" if we can help it16:34
harikt the idea is if no headers are there .16:35
pmjones if there have to be changes to that logic, it means the response object code has to change, as vs swapping out different response-manipulation classes16:35
wdna pmjones: hay... what's up?16:42
pmjones hey there wdna16:42
how you?16:42
brandonsavage left16:42
wdna fine. fine.16:43
I had some issue today with Sql Query. maybe you can advice.16:43
I created a method on my abstract storage that returns the last insert ID for postgresql. I noticed there's no such in aura.16:44
harikt hm pmjones this is what I have been thinking .16:44
wdna first, is that correct? or i jsut missed it?16:44
harikt we have not build the bundle for sql, sqlquery :(16:45
wdna anyway, my issue was the following16:45
pmjones wdna: v1 or v2 ?16:45
wdna i used getLastInsertIdName() from https://github.com/auraphp/Aura.SqlQuery/blob/develop-2/src/Pgsql/Insert.php16:45
harikt wdna, If I am correct there was a method to getLast insert id16:45
wdna v216:45
but. postgres has option to extand table16:46
this means, the the 'seq' for a table can be different than the table name.16:46
pmjones tilts head16:47
wdna i sloved it by calling PDO's last insert function and manually supply the seq name.16:47
pmjones mmmm16:47
wdna i'll give example:16:47
pmjones so the problem specifically is that the column name may be different than {table}_{col}_seq16:48
yes?16:48
wdna exactly.16:48
the seq is in different table.16:48
because the current table just extands it.16:48
pmjones furrows brow16:48
pmjones yeah16:48
man, i have not encountered that problem before16:49
and it's definitely an issue16:49
wdna so, maybe it should be handles somehow on the aura side?16:49
pmjones maybe -- i'm trying to think how to handle that on the aura side16:49
SqlQuery won't know about the schema16:49
wdna I was things, supply the query object with table extention value.16:49
thinking*16:49
pmjones nods16:49
pmjones maybe16:49
wdna $insert->extands('table_A');16:50
if it's set, it'll use that one for postgres.16:50
pmjones gah, that'd suck if you had to do it *every time*16:50
wdna well16:50
the value of the seq, is actually in the table schema16:50
pmjones wdna: i'm with you that it's a problem. can you enter a ticket for it on github?16:50
wdna but then you have to make query to read it.16:50
pmjones nods16:50
pmjones postgres is always the tricky one on insert IDs16:51
harikt :)16:51
wdna yes, i'll open with example. np.16:51
pmjones thanks16:51
harikt on another note I did played with middleware some days back16:56
https://github.com/harikt/Aura.Web_Kernel/compare/develop-2...middleware?w=116:56
ok guy me leaving17:03
pmjones, simensen talk later.17:03
pmjones sleep well harikt !17:03
harikt oh and yes joelclermont bye! . Sorry I missed to see you for a long .17:04
Hope you are doing good.17:04
Thanks Paul.17:04
joelclermont i was out of the office for two weeks :)17:04
back today finally17:04
harikt cool .17:04
talk tomorrow then :)17:04
harikt left17:04
wdna left17:51
simensen pmjones: so, what is the point for adr? i tried to find a better way to say that but it really says it best. :)18:35
pmjones i get you :-)18:35
simensen other versions: what is the purpose for exploring this?18:35
pmjones the main problem is that model-view-controller has experienced some drift from its original meaning18:35
ADR attempts refine MVC for the web, using web-specific concepts18:36
additionally, the mixing of presentation code in the controller and the view continues to be a problem ...18:36
... because developers think of the *template* as being the View layer, instead of thinking of the View as something that builds an HTTP response18:37
(which is what it presented to the client)18:37
simensen: does that help at all?18:37
simensen sorta. what is the end-game? people writing ADR frameworks instead of "MVC" frameworks?18:38
people using the terminology differently?18:38
pmjones both, i think18:38
simensen how does it work within projects that have the notion of a controller already but aren't really following the MVC paradigm but really just using the word controller instead of action?18:38
pmjones my guess is that existing MVC frameworks are very easily tweaked to be ADR18:38
for things like Slim, they already do single Actions18:39
(does that answer the quersiotn about "notion of a controller but not MVC" ?)18:40
simensen yes18:41
all of my symfony-ish "controllers" are usually standalone ... i usually try to not create one big "controller" that has a lot of actions in it18:41
pmjones right on18:41
simensen in fact, i normally try to consider the controller to be whatever is called, not class (or a collection of actions) itself18:42
pmjones again, right on18:42
the issue then becomes, "where do you set headers?"18:42
in the controller, or the view?18:42
simensen depends.18:42
pmjones in MVC it's generally the controller or some other layer18:42
in ADR, it's always in the Responder18:42
it sets the headers and body on the response18:43
simensen who picks which responder should be called?18:45
pmjones in the examples, the Action generally has its own Responder18:47
simensen can one action possible return/work with more than one responder?18:48
pmjones having said that, there's no reason an Action could not pick from a ResponderFactory, or that something outside the Action could inject a Responder18:48
simensen (or, say, support multiple implementations of a specific Responder for various output types; html, json, xml, pdf, etc)18:48
pmjones exactly18:48
the pattern does not prohibit or promote that18:49
no reason not to use a common Responder across multiple Actions18:49
provided the responses are similar enough to allow for a common Responder18:49
same way a Controller can tell a View to use a common template18:49
simensen so from my brief time looking, it looks so similar to hexagonal. the only major difference that i can see is that the action is aware of the responder. at least in the examples. but that isn't strictly required?18:50
and to be fair, i've only had a few examples of hexagonal type apps to look at. one was written in silex and i've spent a lot of time looking at the ideas there.18:51
the important part: the action being aware of the responder isn't strictly required?18:51
pmjones not strictly required, no18:53
if you would, please review the EBI comparison in the github doc and tell me what i've missed18:54
simensen What makes ADR web specific?18:56
(i've read that section a few times)18:57
(read it again)18:57
pmjones when you look at MVC and its relatives, one thing you find is that the View updates the Model18:57
on the web, that's not what happens18:57
the client makes a new request, which passes through controllers to the model, and a new view is returned18:57
ADR specifically notes that interaction18:58
you also find that each widget on the screen has its own controller, which is not generally how web interactions work19:01
now, on the client side, that might very much be the case19:01
simensen my brain is kinda cluttered right now. thinking several things.19:02
pmjones nods19:02
pmjones and again, i might be *totally off* here19:02
which is why i'm presenting it19:02
simensen what i'm currently thinking is that what you are describing is an implementation of EBI19:02
however, the interactor concept is very specific to domain modeling, which i think you already noted19:03
basically, the Responder defines what happens on the other side of the boundary19:03
Typically, the "controller" would drive the call to the interactor19:04
However, your "action" is basically saying, "the interactor can be any code that talks to any domain stuff"19:04
(super technical description there)19:05
but that seems to be the only major difference / hole to me between EBI and ADR at this point. that interactors have specific meaning and are already well defined whereas action is more open.19:05
pmjones (back in a few mins, phone call)19:06
simensen i guess where i'm ultimately going with this is that it feels like the patterns are very very similar. and that there might be some issues w/ naming things completely different if they mean something else. so if the pattern could be named / use the same language as similar patterns it might be easier for people to adopt and use?19:06
sure, no problem.19:07
joelclermont left19:10
brandonsavage joined19:23
simensen or maybe ebi can sit behind adr. i dont know. :)19:32
pmjones hey simensen, back now20:10
long call20:10
reading your comments now20:10
simensen ok =)20:11
i have more ideas but thought i'd wait to discuss other stuff first. hopefully i still remember thn.20:11
pmjones email me some notes :-)20:11
regarding EBI, simensen, i see the similarities20:12
as i note in the document, i am not terribly familiar with it so it's hard for me to compare20:12
having said that, i menttion (as do you above) that maybe EBI fits the Domain portion of ADR20:13
*maybe*20:13
to wit, "ADR might be considered subordinate to or a subset of EBI"20:13
simensen: i mean, look at the EBI narrative here: http://www.whitewashing.de/2012/08/13/oop_business_applications_entity_boundary_interactor.html20:15
the Action and Responder totally fit the Boundary description, but the EBI pattern doesn't really describe inbound and outbound boundaries20:15
Interactors might fit the Domain portion of ADR, depending on how you did it20:16
and Entities lie beneath that, also fitting into Domain in some ways20:16
hell, on further reading, it seems that the Boundary too might be part of the Domain20:17
note later in that documnet, "This design pattern very closely resembles what Fowler calls Service Layer pattern in PoEAA."20:18
which is a Domain pattern20:18
in fact, based on that re-reading, i will need to re-write a bit of the EBI comparison20:19
EBI seems like a complement to, not replacement for, MVC and ADR20:19
simensen: ^^20:20
simensen ebi is definitely domain heavy. =)20:21
pmjones simensen: so, does that soothe your conscience regarding "is ADR just EBI in drag?"20:40
simensen pmjones: i think i need to let it settle some =)20:40
pmjones that's fair20:40
i look forward to hearing from you on it later, then20:40
simensen pmjones: sure. :)20:40
lots of stuff floating around my head right now20:41
pmjones nods20:41
pmjones i get that20:41
wdna joined20:59
amystephen joined21:36
brandonsavage left22:40
brandonsavage joined22:43
brandonsavage left22:43
brandonsavage joined22:50
brandonsavage left22:52
wdna left23:38
brandonsavage joined23:51

Logs Search ←Prev date Next date→ Channels Documentation