Cloning (copy) a record in BE or BT?

Posted by rvkanten on 23-Jul-2014 04:41

If I want to code the cloning (copy) of a record, what is the best place according to the OERA?

A B(usiness)E(ntity) or a B(usiness)T(ask)?

Posted by Mike Fechner on 23-Jul-2014 10:05

Are you implementing your BEs like in Progress initial samples around ProDatasets?

Knowing not anything about your implementation, I'd probably implement such a specific clone routine in the business entity and not as a task. We use tasks for larger units of logic, eventually using multiple business entities.

Cloning a single appointment record or object might be code functionality of a BE.

But anybody implements the OERA in his own individual way.

Von meinem Windows Phone gesendet

Von: rvkanten
Gesendet: ‎23.‎07.‎2014 16:59
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Cloning (copy) a record in BE or BT?

Reply by rvkanten

Let me rephrase the question.

Assume I have a business entity for appointments and I want to perform an action to create a new appointment based on a existing appointment. Where should I code the creation of the new appointment, in the business entity or in a business task?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

All Replies

Posted by Thomas Mercer-Hursh on 23-Jul-2014 09:48

The problem with the statement of the question is that "record", per se, should only be a concept in the Data Access layer so, actually, the answer is neither when expressed in terms of "a record".   What you should be thinking is that you have a business entity and, for some reason, you want to clone that.  How you accomplish this task is likely to depend on other aspects of your architecture.   For example, if you use a Factory pattern to create business entity objects, then it would be a likely job of the Factory to do the actual cloning.  A task enters into the picture because presumably the need to clone enters into some business process and the cloning is one step in that process.

Posted by rvkanten on 23-Jul-2014 09:58

Let me rephrase the question.

Assume I have a business entity for appointments and I want to perform an action to create a new appointment based on a existing appointment. Where should I code the creation of the new appointment, in the business entity or in a business task?

Posted by Thomas Mercer-Hursh on 23-Jul-2014 10:04

My answer still stands.  The question is, in your implementation, what is responsible for creating BE objects.  That does the clone.

Posted by Mike Fechner on 23-Jul-2014 10:05

Are you implementing your BEs like in Progress initial samples around ProDatasets?

Knowing not anything about your implementation, I'd probably implement such a specific clone routine in the business entity and not as a task. We use tasks for larger units of logic, eventually using multiple business entities.

Cloning a single appointment record or object might be code functionality of a BE.

But anybody implements the OERA in his own individual way.

Von meinem Windows Phone gesendet

Von: rvkanten
Gesendet: ‎23.‎07.‎2014 16:59
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Cloning (copy) a record in BE or BT?

Reply by rvkanten

Let me rephrase the question.

Assume I have a business entity for appointments and I want to perform an action to create a new appointment based on a existing appointment. Where should I code the creation of the new appointment, in the business entity or in a business task?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Mike Fechner on 23-Jul-2014 10:07

I kind of disagree. When a single business entity may hold multiple appointment records, the business entity may be responsible for cloning.

Von meinem Windows Phone gesendet

Von: Thomas Mercer-Hursh
Gesendet: ‎23.‎07.‎2014 17:04
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Cloning (copy) a record in BE or BT?

Reply by Thomas Mercer-Hursh

My answer still stands.  The question is, in your implementation, what is responsible for creating BE objects.  That does the clone.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by rvkanten on 23-Jul-2014 10:11

To answer your first question: Yes, we implement BE's around PDS's.

Posted by Mike Fechner on 23-Jul-2014 10:30

In that case, I'd clone the record in the BE.

Von meinem Windows Phone gesendet

Von: rvkanten
Gesendet: ‎23.‎07.‎2014 17:11
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Cloning (copy) a record in BE or BT?

Reply by rvkanten

To answer your first question: Yes, we implement BE's around PDS's.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by agent_008_nl on 24-Jul-2014 06:27

I would do it in the be to (in your case oera.base.businessentity.cls). But do you have special reasons to doubt Roger?

This thread is closed