AstonJ

AstonJ

Will being able to organise/work on individual components of an app by component directories be possible with Hologram?

Interesting - I hadn’t thought of it like that, but I guess if Hologram is always going to ship with Phoenix then you’ll always have Phoenix and all of its benefits. This does sound very appealing!

And in that case something I would really love, and not sure if Bart has thought of this, is a way to build my apps as a series of components. I think Phoenix Contexts does this in a way, but I’d love to build apps as a series of components that are reflected in the directory structure. Many frameworks are centred around directories for Models/Views/Controllers etc, but I’d like directories for components and then each related file in there, with MVC directories if need be. This just makes it easy to work on individual parts as well as easily being able to slot in/out different versions (which could be almost nothing like each other). It just feels right to me and I think would be very attractive to developers as working on individual parts of an app in this way would feel a lot less overwhelming than working on one big one, enabling solo devs or small teams to tackle or focus on one thing at a time, rather than the whole thing.

Most Liked

bartblast

bartblast

Creator of Hologram

I think what you’re describing is vertical slicing architecture - and I have great news! This is exactly what will be possible in the standalone Hologram version. Actually, supporting this kind of structure is one of the key reasons why standalone is needed.

Here’s how it will work:

When you generate a new project with the Hologram project generator, you’ll start with a horizontal slicing structure - all your app directories organized by technical layers (pages, components, services, etc.) in one flat folder structure.

But as your application grows (or really, whenever you want), you’ll be able to switch to vertical slicing and reorganize the app folder into feature/domain directories like shopping_cart, accounting, etc. Each subfolder would have its own subdirectories for pages, components, services, tests, and so on.

I think it usually makes sense to start with horizontal slicing because in the beginning you don’t always know exactly what you’re building, and this way you can save time not overthinking boundaries (similar to how you’d start with MVC). Later, once the application grows and patterns emerge, you can reorganize the code better.

Note: Vertical slicing won’t be possible in the first standalone version, but it will be supported eventually.

So Hologram will have two modes:

  1. Embedded - where you use Hologram alongside Phoenix or even together with Phoenix LiveView
  2. Standalone - very simple to use, with a very simple structure, no configuration needed. Just install and start adding features.
AstonJ

AstonJ

Ah this is awesome! For me, being able to tackle and focus on one part of an app at a time is a huge plus - not just in the initial make-a-start phase (far less overwhelming if you break an app into smaller components) but I feel you are also more likely to actually spend more time on each component as well as continuing to go back to them to refine them, because they’re self-contained meaning you don’t have to overstretch your bandwidth (which at times can often be limited if we’re busy/stressed out/working towards deadlines/etc).

Let’s split these posts into a separate thread in case anyone else is curious or wants to add their thoughts too :icon_biggrin:

Where Next?

Popular in Questions Top

ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement