Re: advise on best practices guides and projects
Lew wrote:
Tom Forsmo wrote:
Go for good encapsulation and programming by interface. Often that does
mean layers, but not fractally and not always.
Fair enough, but sometimes I feel the encaspulation and extra objects is
annoying extra work.
with its requirements for domain model transformations
If you understand what that phrase means, then you're fine doing that.
Only if is is needed, but when is it ok to use it.
Passthrough constitutes complexity?
When the layer is mostly passthrough, its extra code that doesnt really
doesnt do anything except complicates the call chain, introduces extra
parameter handling and error handling for no real benefit. This
complicates maintenance of the code.
If the layer does nothing, are you sure it's a real layer?
Exactly, but other principles say there should be a layer there.
E.g.
SOAP Facade layer ---> Domain layer ---> DB layer ---> Postgres DB
For maintainability there should be a domain layer because it separates
the communication solution from the application server, but if the
domain layer is mostly a passthrough, except for a couple of methods
that to questionable domain logic, I dont see a practical need for the
layer. But in later stages it might also contain some technical code
such as, caching, exception handling strategies and last but not least
the exception barrier. So the domain layer has little domain logic but
rather technical logic.
The DB layer has the tasks of managing all db communication and convert
from db datamodel to app datamodel.
If the layer is separate from the one above it, and separate from the
one below it, and does nothing, doesn't it stand to reason that with its
removal, the other layers would still be separate?
Don't lock your dogma in your karma in the parking lot on hot days.
Fair enough, but when to do and when not to, that is the question.
- how to represent results to be returned from a tier or dao
Result result = tier.execute();
I have come to the same conclusion, but only if the tier or dao is
represented as an interface.
- how to pass arguments to and from tiers and strategies.
Result result = tier.execute( new Argument [] { arg1 } );
Here you say it should be an array of arguments, which is a solution I
have rarely seen before. The solution I have seen is usually either 1) a
collection of similar objects or 2) as a single Argument interface
*You're* tired! I'm in this business decades and still asking the same
questions. Get used to it.
What I mean is that these questions are basic questions I should have
most of the answers to already. The questions I will have to get used ot
is the more advanced ones, architectural ones, not day to day
programming questions.
regards
tom