Browse Source

Planning a new project

master
Julio Biason 2 years ago
parent
commit
75e9bf9449
  1. 43
      content/projects/rubidium.md
  2. 15
      content/thoughts/the-types-of-oop.md

43
content/projects/rubidium.md

@ -77,9 +77,50 @@ pub struct Case {
pub struct Step { pub struct Step {
name: String, name: String,
command: Command,
}
pub struct Command {
command: String, command: String,
name: String,
} }
``` ```
After reading the data from the disk, the code could check if the step is "valid", After reading the data from the disk, the code could check if the step is "valid",
like checking if the command exists and can be called. like checking if the command exists and can be called. The `Command` doesn't
exist in the configuration file, but it is generated while being loaded; the
command itself it is the command specificed in the runner configuration file,
but its main component is extracted and put in the name, to make it easier to
display to the user; for example `/usr/bin/ls -lha` in the configuration file
would have the same value in the `command` field, but the `name` would be
simply "ls".
For every structure, they is a "sister" structure "Run", with the results of
the execution:
```rust
pub struct CaseRun {
case: &Case,
status: CaseRunStatus,
}
pub enum CaseRunStatus {
PendingSteps, // there are still steps to be run in this case
Completed, // no more steps available
Error, // one step failed and it shouldn't run anymore
}
pub struct StepRun {
step: &Step,
status: StepRunStatus,
output: String,
}
pub enum StepRunStatus {
Waiting,
Running,
Done,
Error,
Skipped,
}
```

15
content/thoughts/the-types-of-oop.md

@ -31,10 +31,11 @@ base class in a child class and overrides the method. And that's basically it.
But, in real life, things are not quite like that. But, in real life, things are not quite like that.
Ok ok, there are examples in real life that are basically that, but I don't Ok ok, there are way more examples of things written in real life OO beyond the
think we *start* with that, we *use* that. ones I talk here, but in my experinece they are not that common. Of course, your
mileage may vary.
So, what do I mean by "Types of OOP"? So, what do I mean by "Types of OOP" in "the real world"?
## The Grouping ## The Grouping
@ -162,3 +163,11 @@ everywhere.
{% end %} {% end %}
## The Framework ## The Framework
The last common OOP design I usually see is what I can call "the
framework". Usually, projects are not written in this style, but the framework
they use allows this.
The framework is focused on having lots of methods in some class that you extend
and override a couple of methods. For example, if you are using Django, you may
use

Loading…
Cancel
Save