Reputation
501
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 9
Newest
 Yearling
Impact
~9k people reached

  • 0 posts edited
  • 0 helpful flags
  • 12 votes cast
Feb
8
comment Sharing identical events, with differing scopes, between client and server libraries, in a micro-service architecture
By scope, I don't mean who's listening, or even who's capable of listenening - which may not be possible if the event fires on a different server. What I mean by scope is when (under what condition) does the event fire? If, by definition, an event fires when any user is created, is that the same event as one that fires only when some users are created? Of course, yes, events are broadcast, so by definition we don't (shouldn't) know if anybody is listening - but we're actually talking about what gets broadcast, not to whom, right?
Feb
8
comment Sharing identical events, with differing scopes, between client and server libraries, in a micro-service architecture
I still have no answer to this. I guess the question really boils down to: what defines an event? Is it defined only by the shape and payload of the event itself, or is it also defined by it's scope, even if a change in scope produces no tangible difference in terms of shape or payload?
Feb
5
comment How can I design a model layer without ORM, and when should I use it?
"ORMs are undoubtedly a clever bit of kit, but so is SQL" - this sounds like precisely the reason for Pomm, which tries to strike a balance, by abstracting only the "hard parts", while allowing you all the expressiveness of SQL. If only there were something like this for MySQL.
Dec
15
comment Terminology: abstraction vs models
@gnat I read the accepted response to that question, and it resounds with my understanding of abstraction. But it doesn't resolve my question. In a nutshell, what is the difference between a model and an abstraction? Is one a superset of the other?
Dec
15
comment Terminology: abstraction vs models
Does a model have to model a real-world entity? In this case, my domain is SQL, so the entities I'm modeling are Query, Condition, Join, etc. - even if those are already abstract entities (translating to an execution plan against physical data on a disk at a lower level) in terms of the domain I'm modeling, those are my entities, is that correct?
Nov
3
comment Are (database) integration tests bad?
@PaulK still pondering which answer to mark as accepted, but I'm leaning towards the same conclusion.
Nov
2
comment Are (database) integration tests bad?
I get your point, but I think this used to be more true than it is today? With automation and tools (like Docker) you actually can replicate and repeat the setup of all your binary/server dependencies accurately and reliably for integration test-suites. Of course, yes, physical hardware (and third-party services etc.) can fail.
Nov
2
comment Are (database) integration tests bad?
@el.pescado the query is there only to illustrate the dependency on a DB connection - I have clarified this above.
Nov
2
comment Are (database) integration tests bad?
Yes - the example I used, as pointed out, is trivial; a real repository could have all manner of complex search and sorting options, e.g. using a query builder, etc.
Nov
2
comment Are (database) integration tests bad?
@Ben yes, I use a non-production DB for testing (e.g. a local development server or disposable Docker instance) - same for things like web-services where possible. Actually, web-services are another great example - if you're writing a REST API client for a third-party service, I realize you can store and play back (or fully mock) the HTTP responses, but again, it doesn't prove that it still works; even if it worked at the time of testing, a third-party service could change and break your client.
Nov
2
comment Are (database) integration tests bad?
@DocBrown that's cute, but it doesn't really seem to address mocking. (there is one mention of mocking, but providing no clear conclusion or context.)
Nov
2
comment Are (database) integration tests bad?
@CaptainMan in a real integration test, I connect to a dedicated test-database - on the real server though, not a memory database or some other lightweight stand-in. Otherwise, I can't test the actual integration. The test automatically deploys the schema in advance of running the tests, etc. so the whole thing is disposable, repeatable, and safe.
Nov
2
comment Are (database) integration tests bad?
@user61852 it says "naive" in the description, yes?
Nov
1
comment Is ORM an Anti-Pattern?
There is now hard evidence to support the claim that ORM patterns are fundamentally flawed: blog.acolyer.org/2015/09/04/…
Feb
26
comment Changing method signature for implementing classes in PHP
@user61852 I'm not saying this to defend PHP (believe me) but, but most languages would not let you change an inherited method-signature - historically, this was possible in PHP, but for various reasons decided to (artificially) restrict programmers from doing this, as it causes fundamental problems with the language; this change was made to bring the language more in line with other languages, so I'm not sure which language you're comparing to. The pattern demonstrated in the second part of my answer is applicable and useful in other languages like C# or Java as well.
Aug
3
comment does this model-pattern have a name?
I received the following answer from Martin Fowler: "I’ve seen various things like it. The operational/knowledge layer distinction in my Analysis Pattern book is about this. Various people wrote up something like this under the name “Type Object” (an example is ksc.com/article3.htm, but I’m sure there’s more to dig out.) I remember something in Peter Coad’s work too. I bet there’s others, although I haven’t dug around in this territory for a while." - it looks like the "type object pattern" is more of an OOP generalization of the "data descriptor" pattern?
Aug
3
comment does this model-pattern have a name?
Very good, but I still don't see anything describing the idea of mirroring property-names 1:1 in the descriptor? Fundamentally I agree, this is a data-descriptor, but it's a little more than that - mirroring the property-names enables a kind of "cross reflection" going either from a property in a descriptor to an object property value, or vice-versa. I don't guess that makes it a new pattern though, just an extension to an existing pattern. Should I mark this as the correct answer?
Jul
23
comment does this model-pattern have a name?
@Alex I agree that data-driven programming (and model-driven architecture) is an approach, not a pattern. It still seems like I'm following a pattern though, I mean just at the low level, of every model-type having a meta-type with the same shape - the consumption of that meta-data by helpers and services is an approach, but it seems like following the implementation pattern is what makes that approach practical. Maybe that doesn't make it a pattern, but then I'm not sure what does. (?)
Jul
21
comment does this model-pattern have a name?
@Alex because it's not just data - if it were, you could just as well embed it as annotations and use reflection. So perhaps more accurately "metadata-types", which I guess I just kinda shortened to "meta-types". The bigger question is, is this a known pattern? If it is, it can't be very common - I have never seen it mentioned or described anywhere, and I find that suprising, given how well this actually works in practice.
Jul
16
comment does this model-pattern have a name?
Other terms I've used at times: "co-typing" or "meta-types". I like "type descriptor" best, it bugs me that it refers to a C# language feature, because it accurately describes what this other type is for. Do you know if "type descriptor" means anything in programming in general, or is it just something MS came up with for C#?