java - In which layer should be map/change/format the data? -
imagine have java project 3 different layers: ui (swing), service , dao. ui calls service, , service calls dao.
in ui have filter calendar. when search run, selected date (and time) in calendar sent parameter service.
the problem time of date needs formatted last second of day (23:59:59), formating has done.
first question, have format/change date , time. in ui or in service? because if change in ui, can reuse service method date , time. if change in service, need new method in service if current time needed instead of last second of day.
and thing, idea name service layer "service" if exist data transformation, or better name "action layer" or this?
it depends! general advice kind of formatting goes clint/application layer if formatting business requiement of services should go service or business logic layers. ask whether formatting should apply or not. chose solution makes service more reusible.
Comments
Post a Comment