Wednesday 25 November 2009

Software Engineering – Domain Modelling

What is Domain Modelling?

Domain Modelling is a way of representing the context  in which the software must operate – to understand the software better. However, one must remember that you’re not modelling the software to be built!

A better description would be:

A Domain Model in Software Engineering can be thought of as a conceptual model of a system which describes the various entities involved in that system and their relations.

http://en.wikipedia.org/wiki/Domain_model

 

 

Domain Modelling 101

  • Go through the available data sources; such as the original description; Use Cases; Glossary etc etc. With this, you must then identify possible Domain Classes (noun phrases)
  • Identify basic relationships between the domain classes.
  • Add addition key attributes
  • Pay attention to the relationships, like names and multiplicities – it is very important that these are correct!

Domain Modelling Example

Now for the moment you’ve all been waiting for, an example! :D Sadly a Domain Model doesn’t have any stick people in it, so there’ll be no awesome stick people of awesomeness :(

Lets say we have the following information for a basic Student Library System:

Courses may have recommended items of Reading Material, which may be either complete Books or individual Chapters. Items of Reading Material may also allows a user or floppy for every NFA there is i for for have Reviews associated with them.

Now with this we need to identify 5 classes, can you see what they are?

Hint: i cheated a little, they’re in italics…. :P

So, yeah… we have the 5 classes of:

  1. Courses
  2. Reading Material
  3. Books
  4. Chapters, and
  5. Reviews

And with this, this is what the Domain Model looks like:

BookDM-fixed

 

Before I start to explain what this shows, lets explain the arrows and numbers:

  •  DMline  This is the first thing. This – obviously – is a line. When we see a line connecting 2 classes together this shows us that these 2 classes are related. The text that lays on the line, ie “provides”, says that Course is related to Reading Material as a “Course provides Reading Material”.
  • DMarrow An arrow implies a relation of inheritance. So for the diagram above, its should be obvious that a Book will inherit some methods from Reading Material. A more better example of this could be if we thought of this in a Java/C++ sense. For example, we create a Person Class and then create a Student Class, a Student will inherit methods (etc) from Person, such as getAge() and getHeight() , as well as name and age etc etc.
  • DMcontain This is a line with a funny looking diamond thing on the end. What this states is that class ‘A’ contains class ‘B’. For example, above we say that a Book contains Chapters – which is obviously true, else it would really be a book…
    Another example would be if we had the classes Wallet and Money. So we could have Wallet => contains => Money.
  • The final one is the numbers; so (0, 1, *, 0..* and 1..* and many more). What these state is a relation such as one-to-one, or one-to-many. In the example above we have these numbers on the contains relation for Books and Chapters. So we say that a one (1) Book contains one or more (1..*) Chapters.

    Alternatively we can also say that one (1) Course provides zero or more (0..*) Reading Material.

    As a note, remember that we can only use these numbers on plain relation lines and contains relations. we do NOT use them on inheritance relations! :)

And i think that’s it for Domain Models :D , sorry for doing this one a little late, i had some issues with the diagram above. However, many thanks to James Bedford, Daniel Lyon :D

Tuesday 24 November 2009

Software Engineering - Software Testing Concepts

Software testing concepts


The fundamental rule of testing is that 'a successful test is one that causes the software to fail.

You can have a testing team who didn't write the software do this.

An agile solution would be to write the tests before the code. This helps to clarify requirements too.

Software Engineering – Design Class Diagrams

Design / Object Classes

A Design Class diagram is a way of modelling the domain to a level of detail much more than that of a domain model. Inside a design class diagram, the classes become objects – Object Classes:

Monday 23 November 2009

Software Engineering - Software Design Intro

Intro to software design


Embury's law


Remember this?

The software has bugs in it, we just don't know what they are yet.



This applies to all non trivial software systems. It's fine to assume that some parts of software might be bug free though, for example something that has been translated from another language, as we can check it fully for errors/bugs

Software Engineering - Domain Modelling

Domain modelling


Class diagrams



  • Class diagrams show the different classes and the relationships between them

  • Make sure you don't show too much detail on them

C Guide - Comments

Comments are very important in programming. Could you imagine what you would do if you wrote a program that was hundreds of lines long, and you forgot what a certain function did? or what that variable was for?!

C Guide - Variables

We’ve all done Maths in high school, so you should know what a variable is? Say you had the formula:

2x+3 = 11

C Guide – Hello World!

I was sat here, in my room – fairly bored to be honest… :) – and i started thinking, wouldn’t it be cool to write a C guide to help people! :D

This is my first time ever to attempt something like this, so it could turn out reeally bad, or really well – who knows!

Sunday 22 November 2009

Software Engineering – Use Case Diagrams / Descriptions

UML & Use Cases


UML stands for Unified Modelling Language. They are diagrams to help aid the creation, visualisation and documentation of various aspects of the software engineering process.

Software Engineering - Requirements

What?

Gathering requirements is very important, as they are a way of finding out what the new system should do, as well as make sure that your application supports the appropriate activities.
You are in constant communication with the customer, the users and developers, so that your system will match the users needs.

Operating Systems – Operating Systems Concepts

Computer Hardware

There are many components within a computer, all of which have to communicate with each other. An example of the components are:

Software Engineering - Methodologies

Fail to Prepare – Prepare to Fail

Software projects are HUGE, if you just sat down at your computer and started to hack away at code then you’re screwed from the moment you start. For projects of this scale we need a well defined process or ‘methodology’ to follow.

Saturday 21 November 2009

Operating Systems - Synchronization

Process / Thread Synchronisation


Note: This works the same way for processes and threads, so when I say processes it could equally apply to threads.


Pretend you live in a flat with 2 other people. Maybe you already do (now you don't need to pretend!).

  • Flatmate #1 wakes up at 8am, sees that you've run out of pilk (pig's milk), then goes out for the day.

Software Engineering – An Introduction

What is Software Engineering

Software Engineering is basically just an engineering approach to building software applications. However, a true definition for software engineering appeared in 1968 at the NATO Science Committee and it was meant to provoke thought regarding the current ‘software crisis’ at that time. They defined software engineering as:

Operating Systems - Process & Thread Scheduling

Process & Thread Scheduling


Basic concepts


If there are 2 processes in the ready state and only 1 CPU, the OS must choose which one to run next. The part of the OS that makes this choice is the scheduler. It uses a scheduling algorithm to choose.

If an OS has support for kernel level threads, it is threads and not processes that are being scheduled. Here we are just going to talk about process scheduling but it's mostly the same.

Operating Systems - Process Management

Process management


This is handled by the process manager of the OS (see here)

First a little history..

  • In early computers, only one program could be executed at a time. This is much different from now. Right now as I type this, I am running Finder, Safari, Chrome, iTunes, iChat, RSS, Tweetie, Spotify, Pages and Last.fm (This has nothing to do with the post, I just wanted to show off all my cool apps)

Operating Systems - OS Concepts

Operating System Concepts


What does an OS do?



  • It manages resources:

    • The different processes running have to compete for memory, CPU etc

    • You can't leave sharing upto the individual programs as they won't share!

Saturday 14 November 2009

Algorithms – Complexity and the Big-Oh

A friend once told me that you can only truly grasp the idea of complexity if you make friends with the Big-Oh; And that's exactly what i intend to help you all with here today! :)

Financial Reporting - Market/Book Values

Market/Book Values


Quick example


Some things that are identical have different values.

An empty tin of dog food is worth about $0.10. An empty tin of Paris Hilton's dog food went on ebay for $305.

I think the message here is that most people are crazy, but there is probably some sort of deeper meaning too. If you manage to work out what it is, please let me know.

Financial Reporting - Income Statement Part 2

Income Statement Part 2


Measuring profit in the income statement



  • The income statement measures the profit generated by the business over a period

  • The previous section showed that it isn't always easy as we have to apply our own judgement a lot, like what method of depreciation to use

Sunday 1 November 2009

Financial Reporting - Income Statements Part 1

Income Statements Part 1


Some quick concepts / refreshers



  • Trade receivables are an asset. A trade receivable is money owed to the company for goods that have been bought from them on credit.

  • Capital is a claim on the business, as it represents the investment the owner had made in it.

Financial Reporting - Balance Sheet Part 2

Balance Sheets Part 2


Note: This post follows Balance Sheets 1 so read that if you haven't already.

Some quick concepts / refreshers



  • The balance sheet is a statement of financial position at the time it is made

  • The cash flow statement measures movement of cash over time