Skip to main content

Sequence Diagrams: Theorizing

The activity diagram is all well and good, and can even be super useful in a lot of cases. But for my money, so far in my limited experience, the sequence diagram is where you really start to get a handle on what you need to do as a programmer.

Before the sequence diagram, you're dealing with steps in a process. What needs to happen, in what order, and you could just as easily be talking about employees or way stations or widgets or nothing at all. They're really about systems analysis--that high level, what needs to happen kind of stuff. Really important work, but totally dull from a programmer standpoint.

The sequence diagram is where we start seeing method names and parameters being laid out. The interaction between classes and layers. You start to see what methods you'll need, in what classes, and get a feel for what properties those classes will need. You can see the flow of the data from the start of the operation to the end, note the inputs and the outputs.

In short, this is where one starts to plan the actual code. It's bare bones, skeletal, but you see it. You determine that you complete this use case, you need a certain method in Class A, which takes XYZ parameters. You see what the return is, you decide if you're going to have one or two layers between the user and the database, all the details you need to start typing "public class BananaPeeler."

It's an extremely simple concept, and there isn't much to say about it. But as I've learned over and over and over it's usually the simple things that have the biggest impact. During the CSCI-2630 class, we struggled to sift through hour-long videos of a programmer demonstrating exactly how to code different parts of the program we were building. The struggle, for me, came from the lack of understanding of how everything fit together--the way this gentleman was hopping from class to class just seemed absolutely bananas, and I couldn't figure out how it was working.

Then a guy in my group mentioned CSCI-1275, and how we are trying to program without doing any of the ground work. This made me realize that if I had a sequence diagram, I could chart the path being taken by the the user's input down to the database and back--handy, since on that project we had 5 layers to navigate.

Once I started to spend the first viewing of the videos on developing a sequence diagram, life because so much easier. I could identify the classes I needed for a particular milestone or iteration, and that in turn allowed me to determine which classes needed to be spun up from scratch and which needed to have methods or properties added or modified. In short, it pulled clarity from the fog and turned a straight "copy from the video" process into something that I was able to understand and learn from.

In short (too late), if I can only do one diagram? It'll prolly be a sequence diagram.

Comments

Popular posts from this blog

The Theory: Entity Framework Layer Domain Modeling

One of the things I learned from revisiting C#II's project, eDevices was that planning out what your database schema is going to look like is pretty key to determining how easy your life is going to be down the road. In C#II, the focus appeared to be on breaking up the bigger project into smaller iterations that were built on organically--which was GREAT until I tried to implement a feature that hadn't been planned for in an earlier iteration, one that required changing one of the fields on the Policy entity. I managed to break all functionality because the Policy entity no longer matched what was expected, and I had to completely redesign 90% of my application's business logic to account for this new feature. This led to further frustration when I realized that I didn't properly manage my code first migrations for this series of changes--again, they happened organically during the class without any thought or discussion as to how to go back and make changes. Had t...

Use Cases: Pertaining to the Project

So last time we covered the really high level theory behind use cases and why planning them is kind of important when writing a program. This is the part where I tell you I've changed my mind, I'm just going to totally wing this project since I landed an internship and I don't actually need this program to be professional looking. PSYCH--did you even read how I closed the last post? That was hilarious. But anyway. I didn't actually go through the full CSCI-1275 "discovering your use cases through '20 Questions,' rune reading, and chasing clients for interviews" approach. We spent close to a month on use cases in that class--how to identify them, how to define them, how to model them, and a little on how to prioritize them. The bulk of the class was use cases, and like I said...I get it now. But that doesn't mean I'm doing to sit and actually write out a full CRUD technique analysis of all the ways a single user will interact with a ...

Use Cases: The Theory

They told me in my CSCI-1275 Systems Analysis and Design course there's a tendency for programmers to just start coding stuff without thinking, and this was nigh on tantamount to total catastrophe. I didn't fully understand this until a little later in the semester. We had just learned about arrays and collections in my CSCI-1630 C# Programming I course, and I found this to be a perfect excuse to write a little application that would synthetically divide polynomials . (That's a really great way to master synthetic division, actually, if you're interested in brushing up on that skill. Although my wife still insists the time would have been better spent putting more time into my algebra homework. Two types of people...). At any rate, long story short: I made the program work perfectly, for 3rd degree polynomials that divided evenly. Then I realized it broke when I tried a polynomial of the 4th degree. And then again when the 3rd degree polynomial had a remainder. ...