CSC 216 F09/interfaces2

From Expertiza_Wiki
Jump to navigation Jump to search

Widget Factory

Widget Factory Extreme.

The problem

Within Java and other OO languages, alot of development is done within groups. Interfaces can help with task delegation to other developers, giving them a 'blueprint' for a specific class. This paradigm fits directly into a waterfall development model, and as such is quite useful for programmers to learn. Interfaces also provide for easier code re-factoring and application extensibility.

Participants and props

Ideally, there should be 3 participants. Below they are listed. For more than 3 people, you could add extra analyst with different sets business logic that the factory needed to implement.

Materials needed:

3-5 sheets of paper. Computer *optional*.

Class Developer (Creates Factory.java)
> Implements the method signatures per specification 
Interface Developer (Creates IFactory.java)    
> Determines what the factory needs to do   
> Turns business logic into method signatures    
Analyst (Determines what needs to be made)
> Determines the business logic


The script

The instructor begins as the customer, describing a market for a product.

1) The group analyst takes note of what the customer wants, and designs a set of business rules around this.

Example : The customer wants hot air balloons - which vary in lift power, balloon circumference, material, capacity, and maximum altitude.

So the analyst documents all the variations of the product a customer would need built on 1-2 sheets of paper.

2) The group interface developer takes the documentation by the analyst and begins to create a class outline (the interface).

Example : void setBalloonCircumference(double cir);

etc..

This should be written on another sheet of paper.

3) Once the interface is complete, the class developer must implement each method.

Example : void setBalloonCircumference(double cir) {

this.circumference = cir;

}

etc..

Once again, this should be written on another sheet of paper

4) After the first 3 steps have been completed, if a computer is available, compile the code and run boundary/use cases. Then present the solution to the instructor for feedback.

Credits

John Kwasnick and Josh Hill