My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.extensiblejava.mediator;

import com.extensiblejava.bill.*;
import com.extensiblejava.audit.audit1.*;
import com.extensiblejava.audit.audit2.*;
import com.extensiblejava.audit.*;
import java.math.*;

//If I put this class in the same component as Bill, I've logically decoupled Bill from
//AuditFacade implementations, but have not physically decoupled them. If I put it in the UI
//I limit ability to use it in batch. Putting it in billpay.jar (ie. mediator) works well.
public class AuditFacadeFactory {
public static AuditFacade getAuditFacade(Bill bill) {
BigDecimal amount = bill.getAmount();
int val = amount.compareTo(new BigDecimal("1000.00"));
if (val == -1) {
return new AuditFacade2();
} else {
return new AuditFacade1();
}

}

}

Change log

r74 by pragkirk on Nov 5, 2009   Diff
Initial Version
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 793 bytes, 24 lines
Powered by Google Project Hosting