And we’ve also started to think about the relationships between these concepts. So we’ve picked up a few core concepts we need to model, User, Shift, Roster, and Organisation. We’ll need to support these different relationships in our modelling of the situation, including tracking an individuals relationship with all groups they’re a member of. It’s quite probable that somebody will need to be a member of multiple rosters, and depending on their status within a group, we may have to limit their ability to edit shifts. Now in most groups, not everybody is responsible for creating the rosters, only certain people are, whether they be a boss, manager or a dad helping out their kid’s sporting team. And these people are building rosters to meet the needs of their group, so we’ll need a way of representing those groups in our application too. Now, a roster is really just a collection of shifts that people will be working, so we’ll also need to model both of those concepts, shifts and people. Our application is a rostering application, so a concept of a “roster” is definitely going to be a part of it. Now before we go bashing away at the terminal or IDE, since we’re just starting with our app let’s sit down and spend some time mapping out some of the bigger concepts we’ll need to include with our application. Worse still, with that sort of system it’s easy for the roster to be changed without someone realising, potentially resulting in them missing a shift. I’m still amazed when I hear stories of people having to go in to work to look at a printout of an Excel spread sheet to find out what their shifts are for the coming weeks. Rostering is a necessary part of many groups, including small businesses and sporting associations.Īs many people can also attest it’s very easy for rosters to be poorly managed. Building An Appįor our first foray in to Phoenix, we’re going to be building out the beginnings of a rostering application. Running the below incantation in your command line of choice should result in you with a version of Phoenix >= v1.3.0.Īnd that should be pretty much it, pretty easy, right? You can run mix -help to list out all your available mix tasks, and if you do so you will hopefully see some tasks following the phx.* naming convention. Installing Phoenix is pretty painless, however at the time of publishing we can’t follow those instructions verbatim, as Phoenix v1.3.0 currently only has Release Candidate releases available. As part of installing Elixir you’ll also get mix, a build tool and task runner for Elixir, which we’ll use throughout this blog post. Instructions for macOS, several *nix flavours and Windows are available on the official elixir-lang website. If you don’t already have a valid elixir environment up and running, we’ll need to get that done first. The previous Phoenix v1.3.0-rc2 code is available in the same repository, and is tagged with phoenix_v1.3.0-rc2. This blog post has been updated to reflect those changes, and the example repository has been updated to reflect all of the new changes. Between the original publication date of this blog post and Phoenix v1.3.0’s official release there were a number of changes that affected the examples in this blog post, including further directory structure updates, different names for schemas and tables created using the generators, and the removal of :required from the generators. This blog post was originally written using Phoenix v1.3.0-rc2. These changes seem to be squarely aimed at helping people that are new to Phoenix make better decisions about their application from the get-go, and so should make it easier for newcomers to grow their Phoenix applications beyond a trivial tutorial application. Based on comments Phoenix’s creator Chris McCord made in this video, now would appear to be a great time for newcomers to Phoenix to start playing with the framework. The big new thing with Phoenix v1.3.0 is the new directory structure that the generators use, and where the generators put different types of code. I didn’t want to simply learn Phoenix, and I worried that if I did I would rely too heavily on what the generators could do for me and struggle any time I wandered off the garden path. I began my Elixir journey attempting to get in to Phoenix, but the syntax and style of Elixir was just too different from what I had used previously for me to immediately jump straight in to a web framework. Articles such as hitting 2 million web sockets in Phoenix impressed me greatly, and really spurred on a building curiosity for distributed systems and functional programming in me. When I first started becoming interested in Elixir one of the things that drew me to the language was how much attention Phoenix was getting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |