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.common.assembly.old; 17 18 import java.util.List; 19 20 import org.kuali.student.common.assembly.data.AssemblyException; 21 import org.kuali.student.common.assembly.data.Metadata; 22 import org.kuali.student.common.assembly.old.data.SaveResult; 23 import org.kuali.student.common.validation.dto.ValidationResultInfo; 24 /* 25 * ASSEMBLERREVIEW 26 * 1) The combination of persistence and translation methods (assemble/disassemble vs get/save): 27 * - has confused some developers 28 * - after working through some of it, it looks like most assemblers would do one or other other 29 * - TargetType vs SourceType is odd looking for persistence only assembers, ends up being Assembler<Whatever, Void> 30 * 31 * 2) Need to come up with a clean way of copying properties that are passthrough without a lot of boilerplate code, but... 32 * - many "passthrough" properties will still have a rename along the way, and possibly a transformation of their position within the graph, e.g. 33 * cluInfo/officialIdentifier/shortName -> proposal/transcriptTitle 34 */ 35 @Deprecated 36 public interface Assembler<TargetType, SourceType> { 37 38 TargetType get(String id) throws AssemblyException; 39 40 Metadata getMetadata(String idType, String id, String type, String state) throws AssemblyException; 41 42 Metadata getDefaultMetadata() throws AssemblyException; 43 44 SaveResult<TargetType> save(TargetType input) throws AssemblyException; 45 46 TargetType assemble(SourceType input) throws AssemblyException; 47 48 SourceType disassemble(TargetType input) throws AssemblyException; 49 50 List<ValidationResultInfo> validate(TargetType input) throws AssemblyException; 51 52 }