Random Musings

June 14, 2009

Interface example in the real world

Filed under: Book Review — haditeo @ 4:05 pm
Tags: ,

Today, i discovered a book titled “Interface-Oriented Design” published by The Pragmatic-Programmers series, when i made a trip to the local library here.

The sample PizzaOrdering interface at chapter 1 made me interesting. The interface concept is described clearly in day-to-day daily scenario.

Here are the sample discussion when you’re ordering Pizza :

Waiter : “Yo”
Me : “I would like to order order large pizza”
Waiter : “What topping do you want ?”
Me : “Cheese with pepperoni”
Waiter : “Where is your address ?”
Me : “1 Oak Street”
Waiter : “Please wait 30 minutes for your order. Thanks”

Imagine that this conversation is actually similar to most of the pizza restaurant. When it’s translated to the interface, it looks like this

public interface IPizzaOrder
  public interface enum Size {Small, Medium, Large};
  public interface string Topping {get; set;}
  public interface string Address {get; set;}
  public interface DateTime RetrieveEstimatedTimeCompletion();

Imagine that restaurant A just need to implement the IPizzaOrder interface in order to “open” a pizza restaurant. Restaurant B also. Clients / customers just need to “set” the proper attributes, such as “Size”, “Topping”, “Address” and finally invoked the RetrieveEstimatedTimeCompletion method in order to know how long is it taking to receive the pizza.


February 18, 2009

“Writing Use Cases” Book Review

Filed under: Book Review — haditeo @ 9:44 pm

I was tasked to write use cases for the current business processes.

After googled around and read few blogs, i have came across this book : http://www.amazon.com/Writing-Effective-Cases-Software-Development/dp/0201702258/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1234964130&sr=8-1 (“Writing Use Cases”)

This is indeed a very good book

Pros :
*) A very detail explanation of each components of Use Cases. Especially how to write steps in the Use Cases, how to define the scope of the Use Cases, how to define the Post Condition of Use Cases, how to use Extension in the Use Cases etc.
*) Examples are included everywhere. There are examples or templates in full dress mode or casual mode of use cases. Frankly i prefer full dress mode in point form rather than long sentences, since i prefer short, concise and “to the point” style
*) Sufficient pictures, illustration and diagrams to add some explanation regarding use cases
*) The components explained are very detail, even though we may not use all of them, but in my opinion, i still prefer all the components listed, such as scope, pre-condition, post-guarantee etc
*) Thin book, only 304 pages, so i can bring it while i commute.
*) Exercises are given at the end of the sections

Cons :
*) I need to read multiple times, in order to understand and grasp the meaning or essence in what the author trying to explain.

Create a free website or blog at WordPress.com.