1 /**
2 * Copyright 2010 The Kuali Foundation Licensed under the
3 * Educational Community License, Version 2.0 (the "License"); you may
4 * not use this file except in compliance with the License. You may
5 * obtain a copy of the License at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing,
10 * software distributed under the License is distributed on an "AS IS"
11 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 package org.kuali.student.r1.common.assembly.old;
17
18 import java.util.List;
19
20 import org.kuali.student.r1.common.assembly.data.AssemblyException;
21 import org.kuali.student.r1.common.assembly.data.Metadata;
22 import org.kuali.student.r1.common.assembly.old.data.SaveResult;
23 import org.kuali.student.r2.common.dto.ContextInfo;
24 import org.kuali.student.r2.common.dto.ValidationResultInfo;
25 /*
26 * ASSEMBLERREVIEW
27 * 1) The combination of persistence and translation methods (assemble/disassemble vs get/save):
28 * - has confused some developers
29 * - after working through some of it, it looks like most assemblers would do one or other other
30 * - TargetType vs SourceType is odd looking for persistence only assembers, ends up being Assembler<Whatever, Void>
31 *
32 * 2) Need to come up with a clean way of copying properties that are passthrough without a lot of boilerplate code, but...
33 * - many "passthrough" properties will still have a rename along the way, and possibly a transformation of their position within the graph, e.g.
34 * cluInfo/officialIdentifier/shortName -> proposal/transcriptTitle
35 */
36 @Deprecated
37 public interface Assembler<TargetType, SourceType> {
38
39 TargetType get(String id) throws AssemblyException;
40
41 Metadata getMetadata(String idType, String id, String type, String state) throws AssemblyException;
42
43 Metadata getDefaultMetadata() throws AssemblyException;
44
45 SaveResult<TargetType> save(TargetType input) throws AssemblyException;
46
47 TargetType assemble(SourceType input) throws AssemblyException;
48
49 SourceType disassemble(TargetType input) throws AssemblyException;
50
51 List<ValidationResultInfo> validate(TargetType input) throws AssemblyException;
52
53 }