<document>
	<properties>
		<author email="a.arif.r@gmail.com">The Dobo Team</author>
		<title>The Dobo Framework(Define Object By cOntext)</title>
	</properties>
	<body>
		<section name="Overview">
			<p>
				Dobo framework is a tools to decoupled object and its
				context. By its nature, object can have different
				behavior in different context. For example : A Person,
				can be a father, software engineer, or a husband.
				Traditional development, by using interface, we expect
				an object has to implement interface in some fashion. Eg
				: Person can implement Father, SoftwareEngineer, and
				Husband. Every object can implement particular
				interface, but what happen if the object actually has
				many behavior in same context scope ??.
			</p>
			<p>
				Eg : Java Software Engineer knows Java language and C++
				engineer knows C++ language. What if, this person master
				in both skill. This can lead some problem. Traditionally
				to solve this situation, we need the Employer to pass
				information to this person, so this person can
				understand what behavior he should do based on the
				employer information.
			</p>
			<p>
				However, the employer cannot pass the information to
				this person, there is no method in SoftwareEngineer to
				tell this person, "doEverythingInJava" ?? And actually
				the Employer wondering why he need to tell this software
				engineer to do everything in java ?? shouldn't this
				person know that this is Java Software Company
			</p>
			<p>
				Another daily case can be found. Think that you are web
				developer, so you implement Controller interface that
				implement a method to process request. So you create
				interface for dealing with Customer you name it
				CustomerController. But you found out you need to
				implement different object for different action. The
				CustomerController is not sufficient. You end up with,
				CreateCustomerController, UpdateCustomerController,
				ReadCustomerController,DeleteCustomerController,
				SomeActionsCustomerControleller, you start thinking
				smart way, using template and abstract object. That
				really helps you because finally you have this cool
				framework to do some dirty job and help your days.
			</p>
			<p>
				But what if actually you found out, that, you don't need
				to extend to a template or abstract class, what you need
				actually is, a Context. CustomerController in some
				context should perform different behavior.
			</p>
		</section>
		<section name="Dobo in brief">
				Before Dobo
				<source>
public class RunnableObject implements Runnable{
	public void run(){
	}
}
				</source>
				After Dobo
				<source>
public class RunnableObject {
	
	@Runnable.run
	public void runMethod(){
	}
}
				</source>
				Before Dobo
				<source>
public class ControllerObject implements Controller{
	public ModelAndView handleRequest(HttpServletRequest request,HttpServletResponse response){
	}
}
				</source>
				After Dobo
				<source>
public class ControllerObject {
				
	@Controller.handleRequest
	public ModelAndView do(HttpServletRequest request, HttpServletResponse response){
	}
}
				</source>
				Before Dobo
			<source>
public class ListenButtonOne implements ActionListener{
	public void actionPerformed(ActionEvent ae){
	// do something
	}
}
public class ListenButtonTwo implements ActionListener{
	public void actionPerformed(ActionEvent ae){
	// do something
	}
}
public class ListenButtonThree implements ActionListener{
	public void actionPerformed(ActionEvent ae){
	// do something
	}
}
public class ListenButtonFour implements ActionListener{
	public void actionPerformed(ActionEvent ae){
	// do something
	}
}
				</source>
				After Dobo
				<source>
public class ActionListenerObject {
	@ListenButtonOne.actionPerformed
	public void listenButtonOne(ActionEvent ae){
	}
	@ListenButtonTwo.actionPerformed
	public void listenButtonTwo(ActionEvent ae){
	}
	@ListenButtonThree.actionPerformed
	public void listenButtonThree(ActionEvent ae){
	}
	@ListenButtonFour.actionPerformed
	public void listenButtonFour(ActionEvent ae){
	}
}
				</source>
		</section>
	</body>
</document>
