Live data from Hacker News

Software Architecture Patterns: 5 minute read

orkhanscience.medium.com

41–50 of 73 posts

Re: Software Architecture Patterns: 5 minute read

#41

Earlier quoted context omitted.

There's also the full-blown book version at https://www.oreilly.com/library/view/fundamentals-of-softwar...

$40 dollaryroos for that boy howdy. No wonder nobody knows how to make software, by the time you can afford a stack of these you already have the job.

It's been that way forever. I live in a third world country, for me $40 is a week's expense (total, including food, bills, and so on). If it wasn't for some, ahem, less reputable means of obtaining learning material, I would be carrying boxes in some warehouse right now.

Re: Software Architecture Patterns: 5 minute read

#42

Earlier quoted context omitted.

> In my book Which book? I see know that one can think of the domain model as most changed layer and if there is a bigger change it is because the domain model changes (e.g. business requirements). So a dependency from the domain model to other parts below are mostly fine.

> Which book? I believe it's used as an idiom. https://dictionary.cambridge.org/us/dictionary/english/in-my...

indeed

Re: Software Architecture Patterns: 5 minute read

#43

What I nerver understood: * How to disconnect the domain model from persistence. Some solutions add the OR Annotations to the domain model. Some other map the domain model to persistence with a Mapper-layer. But all of them have some constraints. For e.g. on a web api I receive a dto, map it to a domain model, map it to a persistence model and vice versa. Not much gained imho. In this example I would add the OR-annot…

Decoupling the physical storage of the model from its logical representation is a very important capability if you want any sort of agility down the road. The way we do this is fairly simple:

- Maintain a common domain model stored in a shared dll. This is a POCO type without any methods or mappers of its own. All it does is contain all the facts you might need. To encapsulate everything into a serializable structure, we place all top-level domain types as collections into an aggregate type simply called "Domain".

- Maintain mappers to/from the domain model in the locations most appropriate for these to live. These mappers could talk to SQL, memory, some noSQL garbo, the user's web UI, etc.

The advantages with this layer of separation almost universally outweigh the downsides unless you can convince your development team to build a more standardized single-process/monorepo product. In a simpler product, I would be more inclined to just directly interact with SQLite via anonymous types.

We have used ORMs like EF in the past, but these get in the way really badly and prevent you from building your logical model in precisely the way you want to.

Re: Software Architecture Patterns: 5 minute read

#44

Earlier quoted context omitted.

$40 dollaryroos for that boy howdy. No wonder nobody knows how to make software, by the time you can afford a stack of these you already have the job.

The Architecture of Open Source Applications[1] book are available for free online, and that Fundamentals of Software Architecture is on LibGen. 1: https://aosabook.org/en/index.html

This is incredible! Breadth, depth and no crap formatting. I can't believe that this isn't more well known.

Re: Software Architecture Patterns: 5 minute read

#45
post #14

Earlier quoted context omitted.

DDD is completely orthogonal to software architecture.

I agree DDD doesn't belong in this list, but this seems a little harsh. Form follows function. DDD is more about understanding the function, and then architecture patterns are the form

DDD works well enough for translating a business domain to computer code, and if your main obstacle is byzantine business requirements it's great, but I wouldn't want to develop something like an MPEG encoder or an operating system based on that principle. They have quite different types of difficulties that don't benefit from DDD.

Re: Software Architecture Patterns: 5 minute read

#46

I tend to design architectures that combine facets of all of these.

Right, although it seems to be a common misconception that such architectures are mutually exclusive alternatives. And terms are relative: Isn't a single microservice a small monolith on its own? Isn't a bunch of monoliths in an enterprise IT landscape that communicate via network so much different from a microservice architecture.

Re: Software Architecture Patterns: 5 minute read

#47

Earlier quoted context omitted.

> I am tempted to merge it with the HTTP model as well, add JSON tags to it. If you add a property which shouldn't be public you have to separate them. For example in the domain model you have a user with email but do not want to expose the email. Second argument: I usually create a simple struct for each method. For example I do not want, that they provide the id for post requests. I want to send the id on get reque…

> in the domain model you have a user with email but do not want to expose the email. You can usually configure that out with @JsonIgnore or something like that. Although this works only for this particular (very simple) example and won't help with e.g. flattening multiple nested objects.

At this point you already have 2 "models", in the sense of 2 "concepts" or 2 "types": the one with the field and the one without. The second one is implicitly defined with these annotations, which has a good chance to be annoying sooner or later when you need it to be explicit.

Re: Software Architecture Patterns: 5 minute read

#50

They are better explained here: https://www.oreilly.com/content/software-architecture-patter...

There's also the full-blown book version at https://www.oreilly.com/library/view/fundamentals-of-softwar...

[Disclaimer: I know both Mark and Neal well. I don't think it matters here but I just wanted that out of the way]

Their follow-up book to Software Architecture Fundamentals is also available on O'Reilly - https://learning.oreilly.com/library/view/software-architect...

Post reply on HN