Open GoogleCodeExporter opened 8 years ago
ha, thanks for solution :), will make the fix soon.
Original comment by i...@polevoy.org
on 30 Oct 2012 at 3:03
������ ����������������!
Yeah, that solution took me a lot of brainstorming :-) I did not have the
line number, so instead I just copied and pasted what I had on my box. It
was past midnight.
Question: with ActiveRecord pattern, where do you keep the business logic?
I feel a bit hesitant to mix business logic with database logic, even if
the latter is fairly abstracted away. So I use activeJDBC models as a
wrapper around my business object. Though I've only been playing with
ActiveJDBC for 2 days, so that may change.
���
Original comment by abc6...@gmail.com
on 30 Oct 2012 at 3:45
we have been using AJ for over 3 years, and a general pattern is to add static
methods to models to wrap more complicated DB access than stock AJ API
provides. When a complex interaction is necessary, we create a simple Java
service class (Facade pattern) and write that interaction in this class(es).
Internally it is like a service and interacts potentially with multiple models.
So, the rule of thumb:
1. If you need complex interactions against a single table (or at most two),
create a static method on model
2. If you need more complex interactions, business rules, operations on
multiple models, write a service class - just plain Java code.
hope this helps,
thanks
Original comment by i...@polevoy.org
on 30 Oct 2012 at 8:04
Original issue reported on code.google.com by
abc6...@gmail.com
on 30 Oct 2012 at 7:03