The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

rualatngua (1) [Avatar] Offline
#1
Hi all!

(In my case) When user change PendingOrder' address or time and add pending order's line items, which following method will be exposed to client:
1/ PlaceOrderFacade.update(Integer pendingOrderId, String address, Date time, LineItem[] lineItem)
2/ PlaceOrderFacade.update(PendingOrder pendingOrder, LineItem[] lineItem)

I like option #2 but client must be load PendingOrder and Facade detache it before time or address is set to detached PendingOrder object.

PS: English is not my mother language so I cann't explain my problems well.
ceracm (110) [Avatar] Offline
#2
Re: Update detach object using POJO facade
You could just use:

PlaceOrderFacade.update(PendingOrder pendingOrder)

The facade's client just updates the line items in the PendingOrder directly.

Yes, you need to load all parts of the PendingOrder that the client needs but it definitely can simplify the code.

Chris