|
|
It’s taken a while, but I’ve finally managed to get my email working properly (send and receive) on my iPhone. The initial setup was relatively easy (my teenage daughter did it for me) but all the messing about at Virgin Media and the problems of mixing so many different suppliers have made the job much more difficult following that initial brief success.
My setup consists of a Virgin Media email account and an iPhone provided through Vodafone. I use Outlook 2003 with SP3 as my email client and don’t have any problems with that. I also have a “3” broadband dongle which I have used with no problems on both my laptop and my wife’s netbook – I’ll explain why that’s relevant later.
Initially, the MS Outlook email accounts were copied across automatically to the iPhone and they worked OK – but I could only receive emails, not send them.
However, once Virgin Media shoved my account onto Gmail it all became much worse and I started to receive all my old emails every time I opened Outlook – building up to over a thousand emails in my inbox!
So, I asked around (several colleagues had iPhones through various different operators, but the only one with anything like my combination – with Virgin Media – hadn’t suffered the migration so far).
A further problem I noticed was that the iPhone clearly confuses email account settings where they share the same POP3 server name – I had three with different SMTP (for sending emails) but the same POP3 account (for receiving the emails) and it kept mixing them up.
One good point – all my email clients got all the messages – even if some got them umpteen times over!
After scouring the internet for solutions – including the rather disjointed Virgin Media coverage at the time – I finally found an explanation and a combination of fixes that resolved the problems.
The problem
To clarify, here are the problems I had to solve: -
- Outlook was filling up with all my old emails – so many that it never got around to the new ones.
- I couldn’t send emails from the iPhone.
- The iPhone mixed up the multiple accounts.
The cause
I identified the following causes:
- Virgin Media is busy migrating all it’s customers to Gmail which has a broken POP3 service (that’s what you use to get your emails) and different rules and settings for logging in. It also doesn’t delete your old emails unless you really work at it – the POP3 service ignores deletes and even when you delete them using the online service, it only moves them to an archive folder.
- Mobile operators block access to other SMTP servers – and therefore provide there own internal servers – often with different port addresses (the last missing detail…). I had the same problem with the “3” broadband dongle – and found the solution to that (I told you it was relevant).
- The iPhone has a bug.
The resolution
The fix involved several changes in various places.
- Virgin Meda (Gmail) – I had to change the user ID I login with from the original alphanumeric email address “S001…..” and so on to my “friendly” email “alias” that I normally use (simon.j.williams@…etc).
- Next, using this alias email address, login to your virgin media email account (http://www.virginmedia.com and click the email link at the top right). Then go to the settings page (link at top right) and select the Forwarding and POP/IMAP tab. On there, under “POP Download” you need to select “Enable POP for mail that arrives from now on”.
- You could also click the links on that page to setup your email clients…
- In Outlook and the iPhone, the user id used for the POP3 settings need to have “recent:” at the start – so in my example, the user ID is “recent:simon.j.williams@…”.
- Finally, you need to change the SMTP server to “send.vodafone.net” and the Port to 143. This works for me!
The last point I realised when I solved a similar problem for the “3” dongle – I had to setup the SMTP server as “smtp-mbb.three.co.uk” (port 25) or I couldn’t send emails, but I was still using the same Virgin Media POP3 server.
And finally,
As a result I now have three email accounts specified in Outlook – the normal Virgin Media account, the “3” broadband dongle, which has the same POP3 server but a different SMTP server, and the Vodafone account which also only has a different SMTP server.
When setting up the iPhone, iTunes picks up the three accounts and you can select the correct one to upload (it keeps forgetting this setting, but shouldn’t affect the phone – just another apple software bug).
Also, at first I had all three accounts copied to the iPhone to see if any of them worked and the iPhone kept mixing them up. I can only assume they use the POP3 server name as the key – a particularly bad choice given the problems mentioned above.
I thought this might be of interest to anyone else who is trying to do a similar task…
I bought the laptop in April 2004, Windows XP Professional and a 40 GB HDD, and I’ve rebuilt it a couple of times and upgraded it with a 120 GB Hard Disk and more memory.
Recently, however, it has started getting very slow, overloaded with all manner of junk software and the hard disk is full to bursting (less than 5GB free) – there is just too much to back up.
So, I decided to add an even bigger hard disk and use it as the excuse to have a cleanup and fix some other problems.
I went to Scan (I live 15minuts away) and picked up a nice 320GB Hard disk and a 1 year Kaspersky security suite – I’ve been intending switching for a while and this is probably the best time.
At the same time, I had priced up an upgrade to Windows 7… yes, I did! Unfortunately, the Upgrade licence is only available for Home Premium not Professional – so that will have to do.
One final little twist – I occasionally “dabble” with Linux (I have even done a couple of client projects on Linux platforms) and I had allocated around 20GB of the previous HDD to a Linux installation. I wanted to do the same with this new one and with 320GB available I can afford the space.
To make sure it all went smoothly I first Googled a few bits of information and came across the following excellent article: http://lifehacker.com/5403100/dual+boot-windows-7-and-ubuntu-in-perfect-harmony. Says it all, doesn’t it? I recommend giving them a good read before you do this yourself.
The Rebuild Process
First things first, I needed to identify all the software installed on my system before the rebuild. That was relatively easy using an excellent application called CCleaner (http://www.piriform.com/ccleaner). I’ve been using this recently to clean up some of my PCs. With this I was able to export a list of all the installed software components – which I then analysed (OK, so I can’t help being a BA) to see which were part of the same application (for example iTunes installs loads of extra junk), and which I would need to re-install afterwards.
Based on the lifehacker article above I planned to install the latest Ubuntu release so I downloaded the ISO image for 10.4 and cut a bootable CD. I booted from the disk to try it and was well impressed with how well it handled the laptop hardware.
I added a few key bits of data (Wireless security key and my “Plan” of action) to a USB drive – both OS’s read it easily enough.
Next, I waited until I could do without the PC for a couple of days – so I started on Friday evening. Then, after one final check of my email, I removed the old Hard Disk and installed the new one – putting the old on into a Thecus YES nano N1050 external case (http://www.thecus.com/products_over.php?cid=25&pid=7) ready to copy the files once the new Windows 7 installation was complete. I had originally bought this last time I upgraded the laptop and it held the now unused old 40GB Hard Disk.
Ideally, at this point I would also have done a backup of anything precious… but I have managed to get away with it anyway.
Now it was time to start building the new system. The instructions suggested I split the Hard Disk in to 3 areas – one each for the two OSs and a huge data partition – so I chose 50GB for Windows 7, 30GB for Ubuntu Linux and the remainder as the Data drive. I created the Linux partition, unformatted for now leaving 50GB free space before it for Windows. I then created a “DATA” partition and formatted it as NTFS.
I rebooted with the Windows 7 installation CD and used the “Custom” option to create the 50GB partition and install windows in it. That went smoothly enough and I was up and running in Windows. I had a look for the updated drivers from Dell – apparently my laptop doesn’t support Windows 7! Anyway, the installer had managed to find drivers for most things – only the video was obviously wrong. In the end I found that the Windows XP version worked fine. I ran the Windows Update a few times as recommended and that improved the driver situation even more.
Next, I attempted to activate Windows (first option – see Clean Install Windows 7 with Upgrade Media) but this failed so I tried the third, “nice” option by re-running the installer using the Update setting from within Windows. This also failed on reboot and left me with an annoying boot option of “Setup Windows”. The 2nd, less “nice” option worked OK. I managed to make Windows the default boot option – right click on Computer in windows explorer, select Properties from the context menu and click Advanced system settings on the left. Click the Settings… button under Startup and Recovery and select Windows 7 as the default.
That aside, I was able to get to know Windows 7 a little before I continued – and it’s quite nice. Lots of things are in different places, but that’s fine once you learn where they are. So far it is much better than Vista – although it looks very similar. Anyway, time for all that later.
I also moved the locations of my Documents, Music, etc. folders – it’s all in the instructions I followed.
Now it was time to install Ubuntu. I put the Ubuntu disk in the CD drive and rebooted. This brought up a CD based OS and on the desktop there was an icon to Install it to the Hard Drive. I clicked it – followed the simple instructions, selected the 30GB unformatted partition, no swap drive (as suggested) and it all installed happily.
It easily read all the partitions, the USB stick and my old Hard Drive in the Thecus case. I installed the NTFS Configuration Tool and it confirmed which partitions should be mounted at startup. I didn’t bother modifying the Document paths – I’ll do that later if I feel the need.
One issue arose when I rebooted – Linux is the default and there are lots of irrelevant choices. A review of the GRUB 2 documentation (https://help.ubuntu.com/community/Grub2) helped – I renumbered the 30_os-prober in /etc/grub.d/ to 06_os-prober and removed execute permission from 20_memtest86+. Now that’s much better when I reboot (Look, I have to do most of my work in Windows, OK?).
Finally
Finally, I went back to Windows to copy the files across from the old disk and install all my usual applications. A few points worth noting: -
- I’ve had problems with Visio rebuilding it’s directory cache every time I use it – this was fixed by ensuring I installed Visio before Outlook (or their respective software suites).
- All of the Microsoft Office applications (Word, Excel, Outlook, etc.) kept displaying their EULAs every time I opened them. This was fixed by clicking on the Word (or any other) executable in the installation directory and running it as Administrator.
- Windows kept putting up a range of dialogs during copying from the old HDD – duplicate files where there shouldn’t be any and other oddities. As a result, I don’t appear to have copied everything completely. No problems so far, but I won’t be re-formatting the old HDD any time soon!
- Sleep doesn’t work! When I try to resume, the screen stays blank. I fixed this by creating my own power settings (right click on the battery icon) and changing all the “Sleep” actions to “Hibernate”. Now it works fine.
- iTunes – the scary bit. I have created an iTunes directory on my Data disk – so I put the old iTunes directory in this. I edited the XML file to change all C: file paths to the new paths. I installed iTunes, deleted the iTunes directory, and copied the top level iTunes folder in it’s place (but not all the media folders). That appears to work fine (the iPhone Apps folder doesn’t show yet…).
Now the laptop is up and running with most of the necessary software reinstalled. It is much faster and has loads of free hard disk space. Bit by bit I am tying up any loose ends and making sure my projects are all running fine. I still have to resolve the Setup issue – but I’ll find a tidy way to resolve that soon, I’m sure.
Now I can get on with enjoying the new features in Windows 7.
A colleague mentioned the BBC iPlayer for the iPhone – so I tried it. Not bad! He also mentioned that he had the icon on his home screen – just like an App. I had a play and that’s when I found out what the “Add to Home Screen” button meant when you click the “+” button to bookmark a web page.
Well, I had to try it for my blog. Hmm, that wasn’t quite as good – just a microscopic peep at my home page. I wanted to know how the BBC had managed to add that iconic icon for the iPlayer!
I found How to create a custom Apple iPhone icon for your Web site that explained it all – and, after a bit of fiddling to make the original Kajabity log fit properly, I now have a much nicer 158×158 PNG icon file for my web site. As he points out, the icon corners are rounded – so I modified the icon to give it a reasonable match to the rounded edges.
The picture shows the icon (a big red “k") along with the WordPress iPhone app (I’ve not used it much yet, but it looks interesting). I got the picture using the Home button and Power button as he describes – it didn’t work at first, but when I did it fairly quickly it worked fine.
As it looks quite good (well, I think so), I plan on modifying the remaining site icons in the same way. The site needs a makeover anyway – but I’m not enough of an artist to create something that looks as stunning as I want (and too stingy to pay someone else to do it).
Feel free to add the link to your iPhone!
Technorati Tags: Apple iPhone Icon
I’ve spent an awful lot of time over the last few years identifying and writing use cases. Often, I am asked a few common questions by people associated with the project – what is a use case, how do you write them, how do you identify use cases, what’s the point of them? This posting will answer two of those questions – what use cases are and how to identify them.
Systems That Do Something
Businesses exist in order to do something. Whether they are service companies or manufacturing – even storage companies – they all do something. If they are already doing it successfully, then there is probably little need for use cases.
Projects, on the other hand, happen when the business wants to do something different. Either a piece of the business or the whole business – either changing what is already done or creating something new. Often, on projects involving UML the project is to produce a software application, but it may also be based around changing business processes or a mix of both.
We talk of systems. A system, in this context is the focus of the project. It can be described in terms of what it is and what it does. It may be a department in a business, or a piece of software. Projects are usually intended to create a new system or change an old one.
The approach adopted implicitly on most projects is to produce a formal description of the new system – and often, to describe the old system in order to identify the differences between the two and the impact and benefits of the changes.
Usually, the project begins by gathering requirements from various stakeholders (people who have a relevant interest in the old or new systems). A key task for the business analyst is to collect and refine the requirements and agree with the business that they represent exactly what they want of the new or modified system. The requirements may be well structured lists of prioritised and attributed statements, or a collection of emails, scraps of paper, references to legislation or a demand to “Make It Better!”
Whatever you have, at this point we have a description of the system in terms of what the business require it to do, with what and how. We need to turn this into a description of the new system.
There are many ways to do this including user stories, functional specifications, Yourdon, etc. For this article, we are going to use UML – and in particular Use Cases.
Modelling System Behaviour with Use Cases
UML gives us a way to describe systems pictorially in terms of what they do and what they are – behaviour and structure.
Use Cases are the Doing part – they describe the behaviours of a system. To a business, the behaviour is only relevant if it interacts with the outside world in some way – and UML gives us Actors to represent the parts of the outside world (people or other systems) that interact with our system. The UML forms are shown in the diagram below – an Actor interacting with a Use Case that sits within the System Boundary.
We need to define all of the behaviours of our system – all the things it can do. We also need to define all of the Actors that interact with the system. What we have is the requirements.
The easy way to do this is to read through the requirements finding every time they mention the system doing something. Each time, try to write a simple sentence in the form “Subject-Verb-Object” where each of the three is either a single word or a phrase. You may need to swat up on your school grammar, here. Ideally, form the verb phrases with “Can” – because you are simply identifying the things the system “can” do. We are not worried yet about “must” or “could”, “when” or “if”.
Below is an example of some S-V-O sentences you might create when reading the requirements for blogging software (such as WordPress):
- A blog author can create a posting.
- A blog author can modify a posting.
- A blog administrator can approve or reject a posting.
- Anyone can read a posting.
- Anyone can comment on a posting
- A blog administrator can approve or reject a comment on a posting.
- The Blog can reject Spam comments identified by Akismet.
Now that shouldn’t be too hard. So, in the first sentence the Subject is “a blog author”, the Verb Phrase is “can create” and the Object is “a posting”. Turn this into a Use Case Diagram like the one below – you can draw it on paper, in a drawing tool such as Visio or, ideally, use a proper UML Modelling tool: -
The others follow the same pattern, except the last one.
The last sentence appears to have the system (the blog) itself as an actor. Instead, we have the system interacting with Akismet (an online service for blogs) to test for SPAM comments on blog postings. Akismet is another “system”, but one that is external to the project – so we represent it as another Actor. Thus the Use Case Diagram becomes: -
The diagram above represents a Model of the behaviour of the system.
Before we move on, it may be worth reviewing the requirements again to try to find any more use cases or actors that we may have missed – and add them to our diagram (and thus to the model). One way to do this is to allocate each requirement to at least one use case (e.g. stick ‘em in a spreadsheet and add a ‘Use Case’ column). If there are any you can’t allocate to a use case you may need another one.
A use case may interact with more than one actor – or none at all. An actor may interact with more than one use case – as in the diagram above. The project scope may encompass more than one System Boundary – perhaps you are modelling the processes of two different teams or two separate computer systems.
Use Case diagrams can get quite large and cluttered. It is therefore useful to break them up into separate, smaller diagrams. This will be significantly easier if you are using a UML modelling tool as it is easy to create new diagrams and add the use cases and actors to them. You can also collect actors and use cases into different groups – perhaps representing different functional or system groupings.
Finally,
So that’s how you identify the use cases – the next task is to refine the model and define any relationships between them.
But not in this posting…
Yes, I’ve gone over to the dark side and got myself an iPhone from Vodafone. I spent ages agonising over which deal, which network and tried to love any one of the other smart phone offerings, but eventually, the Apple marketing engine caught me hook line and sinker. And the 1GB data limit swayed me to stay with Vodafone.
Of course, it may also have helped that half the people I’m currently working with have one and seem to have joined the local branch of the iPhone appreciation society. And there was that smart phone review in PC Pro which put the iPhone clearly at the top of the list.
I upgraded from a Nokia 6110 Navigator which was starting to look a bit battered, but still did the job I needed. In fact the only reason I finally switched was to get decent internet connectivity on the move.
I had it delivered to the office for speed (impatience) and when it first arrived it looked ever so nice but I wanted to set it up properly so didn’t switch it on. When I arrived home, as a treat for my youngest daughter who had just had braces fitted I let her open the box – much to her delight as some of her friends have them. I didn’t get to touch it for another couple of hours by which time it was fully linked to iTunes on my laptop, synchronised with Outlook and loaded with a range of weird and wonderful (free – I’m not mad!) iPhone Applications (iDragPaper!?! Very popular at parties it turns out).
So it’s not too hard to setup, then.
My first impressions are good; its like something out of a science fiction film – an incredible amount of technology fitted into a small, stylish and sturdy package. It feels good in the hand. (I had the same feeling when my wife got her Canon Ixus 40 digital camera – going digital revolutionised our photography. And as for the new iPod Nano I got her for Christmas… Wow!).
Many years ago when I was a kid (yes that many years ago) I “designed” a wonderful futuristic calculator like device that had more features and functions (and a lot of buttons) than is sane. The iPhone does more (except the ray gun…) and all with a better user interface.
But It’s Not All Good…
So before you start to think I’ve been brain washed by Apple, I’d better mention the niggles. Nothing terrible, I hasten to add, but niggling never the less.
First, and fairly important, it’s not quite as easy to make and answer phone calls. Sliding my Nokia was quick and easy, but the little slider on the iPhone screen is much more fiddly and means it’s slower to answer the phone. Also, I’ve added a PIN to the phone, which I never felt the need to do before and that makes it hard to start anything – including starting a call. I’m getting faster, but it’s still slower than a slider. It is, however, better at finding contacts and calling those and that makes up for it a bit.
Satellite Navigation
Next is the GPS. On the Nokia, I got free maps and a pretty good Sat. Nav. application. The maps tended to be a bit older (I wouldn’t buy the updates) but it got me where I needed to go and was quite accurate at positioning me.
Then iPhone comes with a “map” app. It works out where you are but tends to be a few streets off centre in town (using mobile mast positioning) until the GPS gets to work. And it doesn’t do Sat. Nav. without buying an extra application and updates. So I’m going to stick an old SIM in the Nokia and keep using that for driving.
On the other hand, it has Google Earth. That’s seriously impressive – as long as you have…
Network Coverage
…decent network coverage. OK, it’s probably just that I’ve never tried to browse the internet on the train before, but I have noticed quite a few dead spots. But I think some of it is that the iPhone just doesn’t have the same standard of reception as other phones I’ve noticed people using. Again, if you use the Wi-Fi at home (or anywhere you can get a connection) its significantly better. Anything where you are accessing the internet is much better – and at no extra cost, either.
I haven’t worked out how you connect to BT Openzone yet, though.
Battery Life
Awful. I charged it one night this week and it went all the way down to 23% the following evening. Some of that was my daughter playing games on it – but I was at work for most of the day.
Email
Now this is more of a problem. As I said, my daughter set up the email automatically when it picked up my settings from Outlook. Fine, and it collected my emails OK (till Virgin switched me over to Gmail). However, I have yet to send an email from it – in spite of trying a range of different settings for Virgin Media and Vodafone, and taking it to the nearest Vodafone and Apple stores for advice. A further problem is that the iPhone gets the email accounts confused if you have more than one – presumably because they use just the POP3 server to differentiate each one, where I have 3 accounts sharing the same POP3 (to receive emails) but different SMTP (to send them).
The recent messing about with email that Virgin Media have done doesn’t help, but at least I get all emails on all clients. The setup information for them was a pain to track down as well.
I’ll let you all know if – no when – I get it to work.
iTunes
I can’t stand it.
I have to use it to maintain the software, apps and data on the iPhone but, given the choice, Windows Media Player is a far superior application. Yes, I can see that it’s a large application with lots of features – but it falls down in so many ways.
iTunes is slow, fails to find details of albums that WMP has no problem with, lacks the search, grouping and categorisation features of WMP, is not as easy to use for creating and managing play lists. It constantly complains about incompatible content on the iPhone – even though its from the Apple store.
The store itself is also hideously slow and inadequate. Just the ability to search in categories or types of download. It has so many irritating limitations when selecting content to add to the iPhone. Its actually easier to browse the App Store on the iPhone than in iTunes.
The totally proprietary nature of Apple has been taken too far here – it feels like I’m forced to always shop at a small local shop when everyone else is using the hypermarket. And it’s not exactly bug free!
On the Nokia, I used my favourite CD track as my ring tone – you can’t do that on the iPhone. TV Programs – they’re free on the internet but you have to pay for those in iTunes.
Luckily, I’ve found that you can get music off Amazon much cheaper than the prices in iTunes and it automatically adds it to the iTunes library. Incidentally, I tried to get an album just before Christmas – it cost me 4.99 for the CD with free delivery from Amazon, twice that for just the download from iTunes and three times that to go and pick it up from HMV.
Developer Environment
The phone costs a fortune, but as a developer I thought I might throw together an “app” or two which might get me bit of a return. No such luck, you have to have a Mac to install the development environment. They cost a fortune – a major rip off compared to PCs.
Still, my Dad’s managed to find a couple of cheap ones on eBay so I’ll see if he can get me one as well. More computers! My wife will be so happy…
Finally
This is my first post since the end of January – not long after making a New Year’s resolution to post at least once a week. I’m going to blame the iPhone for that, because even with all the whinging above, it’s a fantastic piece of kit and there are a huge number of excellent free applications.
You might enjoy this article, forwarded to me by a colleague, which offers a hint about where all the time has gone… http://www.informationisbeautiful.net/visualizations/the-hierarchy-of-digital-distractions/.
Good night, I’m off to play with my phone.
Technorati Tags: iPhone, iTunes, email
Apparently, I have too much stuff.
The attic is full to bursting, there’s no room in the shed to potter, and I can barely squeeze a single shirt into the wardrobe. So I have to get rid of some of it so that my wife has somewhere to keep all her old handbags “till she can get around to emptying them” or maintain a barely adequate number of shoes to suit all occasions.
The trouble is we’ve already been through this several times over – and when we last moved house we threw out at least a skip load (much of it going to charity shops). Most of the real junk has gone and what’s left has lingering sentimental value, is bound to come in useful sometime, or “will do for the grandkids” (we’re talking many years in the future, you understand). Another excuse is that much of it is just too good to give away!
However, the solution is at hand – eBay. My dad has been using it for a few years to get rid of some of his junk (and bought a lot more) and I have been amazed at some of the items he has managed to sell (and buy).
I like to be well prepared, and with so much to get rid of I decided to read up on the subject – and Make Serious Money on EBay UK: The Bestselling Guide to Buying and Selling on EBay – and Beyond seemed to fit the bill. It suggested I needed to experience eBay as a buyer first of all – I am now pleased to say that my broken Kenwood CD and record players have been replaced and good feedback given both ways. Now I can look at selling something.
The first to go is a box of about 200 Marvel and DC comics I’ve had since I was a teenager. I have read these several times over and always planned to read them again, but never had the time. They are definitely in the “too good to give away” category. I’ve looked at what other eBay sellers have done and most seem to place them as “Buy Now” items rather than auctions – but when I used the advanced search and looked at one or two completed items I found that very few had sold. So, at least for the first few comics I’ll put them on as auctions and see what happens. I’ve checked out the postage and packing costs, both online and at the post office, and ordered a box of hard backed envelopes to send them out in.
Another recommendation is to be open and honest about what is being sold – extra pictures of the comics should help but it costs extra to add them to each posting. What I can do instead is put the pictures on another web site and include a link to them (within certain rules). Now can you guess why I wrote this posting?
As you can see the comics are in good condition, if not perfect. They have been read and enjoyed but well looked after. You can find me at http://myworld.ebay.co.uk/kajabity.
Anyway, I’ll get them all put on eBay along with as many other bits and bobs as I can bare to sell. And I will add a couple more postings to let you know how I get on and what I do with “all that serious money” (hmmm) – and the extra space. More handbags, probably!
Technorati Tags: eBay, comics
I want to emphasise that it is really important that both Business and IT development teams understand UML because it is a powerful communication, analysis and design tool. An understanding of UML and how it can be used is a starting point for significantly more successful IT projects.
Over the last 10 years or so UML has been an important and beneficial feature in all of the projects I have been involved in. I was first introduced to UML by a colleague (Tony Loton ) at the end of 2000. I read Martin Fowler’s obligatory UML Distilled and then built my first few models using IBM’s Rational Rose UML modelling tool.
I’ve used many other UML tools since then and I currently use Enterprise Architect – all the diagrams are created in Enterprise Architect 6.0, but newer versions are so much better. I’ve also been in the position to pass on that knowledge to many other colleagues – and now I am going to pass on as much as I can to you.
What Is UML?
The Unified Modelling Language (UML) is simply a notation. You use it to describe IT systems by creating a set of diagrams using standard symbols to represent its structure and behaviour.
But, as with any notation (like mathematical symbols), it offers so much more when you use it effectively. Just as a mathematician will learn a multitude of techniques and algorithms for manipulating mathematical models, with UML you can create a model of an existing or proposed system and use a range of simple techniques or comprehensive methodologies (such as Rational Unified Process) to arrive at a complete and detailed design for an IT system.
UML defines a set of pictorial symbols (rectangles, ovals, lines and other shapes) each representing a different piece of an IT system that are used to draw diagrams describing it.
There are several different types of diagram, each representing the system from a different point of view. Some describe the behaviour of the system – what it will do – while others describe the structure of the system – the parts that fit together and the relationships between them. In larger systems, each point of view can be divided into several diagrams showing smaller parts of it.
Underlying all of these diagrams – particularly when you create them with a UML modelling tool such as Enterprise Architect – is the model. Each diagram is a small window onto this model allowing you as a creator to grow and refine the model by focussing on just one small aspect of the model. As a viewer, it presents a clear and unambiguous view of a part of the model – which could be a model of a huge and complex system.
A Couple Of Examples
OK, so now I’ll cut the waffle and show you a couple of simple examples based on features that will be in the next releases of Kajabity Tools (SDI Form classes with File Open/Close and Printing).
First a simple Use Case diagram which describes at a high level what a system should do.
It looks a bit like something a 5 year-old might have done with a stick figure holding 4 balloons. Well, it’s not. This is one of the most important types of diagram (especially if you’re a Business Analyst like me).
The stick figure is called an “Actor” and in this case it represents a person who is going to use an application. The “balloons” are the Use Cases and each one represents a single process or function a user wishes to perform. The examples here are for Printing – e.g. Print Document.
The “string” from the actor “Application User” to three of the use cases indicates that the application user will “Use” each of the three use cases – in other words an Application user can Print a Document, Preview a Printed Document or Change Page Settings.
You will also guess that the fourth use case is “included” in the other three. What that means is that as a part of a process – for example, printing a document – we want to Correct the Printer Margins.
In the next posting I’ll go through Use Case diagrams in a lot more detail, how to create them, more features, the many different ways they can be used and providing more detail in a Use Case specification.
Next, a Class Diagram which describes the parts of a system at a lower level.
As I said, for some readers an introduction to Classes and Object Oriented design will be necessary – however, there are a number of details that most people will quickly be able to see represented in this diagram. This diagram describes “things” (classes), their properties (attributes), what they can do (methods) and the relationships between them.
We can see here that an SDIForm is a kind of Form (because of the type of line and arrow), it has a DocumentManager (called “manager”) and the DocumentManager has a Document (called, reasonably enough, “document”). Also, a TextDocument is a special kind of Document (one that holds Text) and there is a TextDocumentManager which can be used to manage it.
A lot of the details shown in the boxes and on the lines relates to concepts in Object Oriented Design so I will cover this as simply as possible in another posting fairly soon.
Summary
There is a lot to learn in UML, I won’t deny it, and it’s more than just a set of pictures. In any description of UML I am going to have to describe each of the types of diagram and what they represent and how they can be used to illustrate or drive analysis and design.
I will explain forward and reverse engineering and introduce you to a number of related concepts including Objects and OO Analysis and Design (essentially “things that do stuff”) , and Patterns (commonly used structures and algorithms).
All this will give me an excuse for lots of postings over the next few months.
Further Reading
You might find some of the following web sites and books useful: -
http://www.uml.org/ – the website dedicated to UML by the people that look after it, the Object Management Group (OMG).
http://en.wikipedia.org/wiki/Unified_Modeling_Language – a good summary of UML and it’s history.
http://www.sparxsystems.com.au/uml-tutorial.html – a tutorial on the latest version of UML by the people that brought you Enterprise Architect.
Technorati Tags: UML, Tutorial, OOA, OOD
One of the little tasks I have is maintaining the Thistle Society web site and that includes adding photos to the gallery pages. I hold information about each picture in an XML file including the original file name, caption and date taken. Up until now I have been entering all this information manually in the XML but I wanted to try to automatically extract the dates from the photos so I wrote a little application to make it easy to load and edit the XML file.
Having read up on image file formats in Wikipedia and other places I know that all the information I need is will be stored in the image files as image metadata including the Date Created. However, I tried parsing the file details myself – a long and complex job as there are several different versions in different image file formats. So, when I found that GDI+ on Windows handles most of the messy bits I was somewhat relieved.
Starting with a new addition to the Kajabity Tools which provides all the file open/save/close functionality (it will be in the next release, coming soon) it is quite easy to build the application and display all the image details in a ListView (in Details mode). Handling the Item Activated event I open a dialog to view and edit the original image file and stored details.
I added a PictureBox control to load and display the image and a small ListView control (Details mode) to display all of the metadata (PropertyItems). Small problem when I initially tried this – the image hadn’t loaded so I got an exception that the object didn’t exist. This was easily resolved by handling the PictureBox LoadCompleted event and filling the property list then – the columns are the property Id, property type, property length and property value.
void PictureBoxLoadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
try
{
// The PictureBox control is pictureBox - get all the PropertyItems.
PropertyItem[] propItems = pictureBox.Image.PropertyItems;
foreach ( PropertyItem propItem in propItems )
{
ListViewItem item = new ListViewItem( "0x" + propItem.Id.ToString( "x" ) );
item.SubItems.Add( new ListViewItem.ListViewSubItem( item, propItem.Type.ToString() ) );
item.SubItems.Add( new ListViewItem.ListViewSubItem( item, propItem.Len.ToString() ) );
// Code here to extract the value of the property item values...
// The ListView control is listImageProperties.
listImageProperties.Items.Add( item );
}
}
catch( Exception ex )
{
MessageBox.Show( this, ex.Message, "Error loading image metadata" );
}
}
The property value is a byte array whose contents depend on the property id and must be interpreted according to the type and length. GDI+ uses a fixed set of standardised property codes – so once you know the one(s) you need, it’s easy to fetch them. The property I need has Id 0×0132 (PropertyTagDateTime) which has a data type of 2 (PropertyTagTypeASCII – a text string) and a length of 20.
The sample code below shows how to fetch the creation date property and convert it to a DateTime.
try
{
// GDI+ provides standardised definitions!
// http://msdn.microsoft.com/en-us/library/ms534415(VS.85).aspx
PropertyItem propItem = pictureBox.Image.GetPropertyItem( 0x132 );
if( propItem != null )
{
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
string text = encoding.GetString( propItem.Value, 0, propItem.Len - 1 );
CultureInfo provider = CultureInfo.InvariantCulture;
DateTime dateCreated = DateTime.ParseExact( text, "yyyy:MM:d H:m:s", provider );
Debug.WriteLine( "converted " + text + " to " + dateCreated.ToString() );
}
else
{
Debug.WriteLine( "No Property Found" );
}
}
catch( Exception ex )
{
Debug.WriteLine( "Error: " + ex.Message );
}
First, the code shows how to retrieve the value of the property with a special twist – the strings appear to end with a zero byte (like a C style string) so you need to exclude the last byte.
Next, I needed to convert the text to a DateTime. The strings appear to all be formatted using colons – for example “2008:09:27 22:15:35”. I used the DateTime ParseExact method to convert it to a DateTime. Job done.
Of course there was one final problem I had to resolve – many of the pictures were taken on cameras where the date hadn’t been set – so I’m back to manually editing them. Still, it’s a lot easier with a DateTimePicker control.
A very Happy New Year and a Happy New Decade to all who visit my blog. I’ve made a few vague New Year’s Resolutions this year – the usual ones about weight, health and fitness – but one thing I am determined to do this year is make better use of this blog. That is going to involve posting something at least once a week – more often would be better but I’m going for Quality not Quantity. I also hope to improve on the style of the blog and maybe try out some of the Semantic Web mark-ups – just to see what effect they have.
Something else I’ve wanted to do for some time is more creative writing – either science fiction or music. So perhaps there will be something on the blog about that later in the year.
Hope the coming year and decade bring you lots of good things.
Technorati Tags: New Year, Plans
At last, I’ve finally managed to put together a release of the Kajabity Tools – this version just includes a completely rewritten JavaProperties class allowing a C# application to correctly load and store Java style properties from a “.properties” file.
For more details see Kajabity Tools.
The Kajabity Tools-0.1.zip file contains:
- Kajabity Tools DLL – this can be included in a project’s references.
- Sources for Kajabity Tools – including JavaProperties and associated classes.
- Documentation.chm – generated help file from the code comments.
- Licence, Notice – a copy of the Apache License, Version 2.0.
Kajabity Tools is an Open Source project released under Apache License, Version 2.0.
NOTE: Use Kajabity Tools in place of the classes released originally in my earlier posting.
|
|