dolfelt / proton-example

An example of using the Proton framework for a large application.
0 stars 0 forks source link

Add Data Layer #1

Open dolfelt opened 9 years ago

dolfelt commented 9 years ago

Figure out what kind of data layer to add, and which library to use.

I'm liking the DBAL concept, which is what Spot ORM is based on, where you have Entities and Mappers to handle the full connection to the data store.

cc: @shadowhand @ameech

shadowhand commented 9 years ago

I'll throw another library into the mix: JSONModel, but...

From my perspective, deciding on database details is a last step for planning the app, not the first. I'd much rather we focus on how data flows through the system by talking about design patterns before specifics about tools. Here's some fodder for discussion:

https://en.wikipedia.org/wiki/Delegation_pattern https://en.wikipedia.org/wiki/Command%E2%80%93query_separation https://en.wikipedia.org/wiki/Command_pattern https://en.wikipedia.org/wiki/State_pattern https://en.wikipedia.org/wiki/Strategy_pattern

These are not mutually exclusive and we can choose the right patterns for the right parts of the application.

In my mind, the purpose of an example app should be to describe the types of classes that exist, where those classes live in the filesystem, and how to implement a new input/output stream within the application. A good starting point for such a discussion is Clean Architecture and exploration of how a REST API can be effectively modeled using hexagonal architecture.

dolfelt commented 9 years ago

I agree. Just throwing this out there as a discussion starter. This example is far from complete. Mostly I'm trying to get a logical framework for a large application.

I like the delegation pattern a lot and think we could accomplish most of the "clean architecture" using that.