2,214 reputation
1244
bio website
location
age
visits member for 2 years, 9 months
seen Dec 18 at 19:49

Learn PHP the right way: http://www.phptherightway.com

twitter: @songoko20000


Dec
17
comment Maximum nesting for loops and conditionals?
+1 for Clean code reference.
Dec
5
awarded  Popular Question
Dec
4
awarded  Notable Question
Nov
16
awarded  Popular Question
Nov
12
comment DDD and edit of Aggregate's descendants
well it depends :) Validation is a nasty topic which depends on the context. Why are you validating the order? Normally I would validate the aggregate in the constructor or in a dedicated factory class if the validation logic is complex enough. A validator is a service which may change implementation at some time and I hate injecting service s inside entities. It all depends on the complexity of the validation.
Nov
12
comment DDD and edit of Aggregate's descendants
hmmmm why don't you make a function order.validateLines(validator) to encapsulate the validation logic?
Nov
12
comment DDD and edit of Aggregate's descendants
Just wondering, but where did the Line object in public void HideLine(Line line) come from? I mean surely it didn't come from the database because only aggregates have repositories.
Nov
9
comment Is it good practice to catch a checked exception and throw a RuntimeException?
"The price of checked exceptions is an Open/Closed Principle violation. If you throw a checked exception from a method in your code and the catch is three levels above, you must declare that exception in the signature of each method between you and the catch. This means that a change at a low level of the software can force signature changes on many higher levels." —Robert C. Martin, «Clean Code», page 107
Oct
30
awarded  Popular Question
Oct
15
comment Is it wrong to make any form of business decision in a Controller?
Presentation logic should reside in the presentation layer (the MVC project itself). Application logic should reside in the application layer (application services). Business logic should reside in the domain model (domain layer). See Vaughn Vernon's sample application. It's in Java, but it's still valuable.
Oct
12
comment PHP - Repository matrix pattern?
Just a feeling, but this sounds like a 100% CRUD application.
Oct
10
answered Domain Model, validation, and pushing errors to the model
Oct
1
answered Presentation VS Application layer in DDD
Sep
30
awarded  Popular Question
Sep
30
comment Is creating subclasses for specific instances a bad practice?
Design your classes depending on behavior not data. To me the sub-classes add no new behavior to the hierarchy.
Sep
18
comment Why is it good to split a program into multiple classes?
One reason I heard Robert C. Martin mention is independent deployability. This is more related to dependency inversion (the D in SOLID), but still is important when working on a big project.
Sep
16
comment The importance of duplicate code removal
His primary argument was that "he's a good programmer...". Well here is your problem :)
Sep
15
awarded  Tumbleweed
Sep
14
answered Domain model associations that do not required the behaviour of the associated object. How to model?
Sep
14
answered How to work with large aggregate roots?