12.07.2015 Views

Full Paper Tutorial Short Paper Letters - Nectec

Full Paper Tutorial Short Paper Letters - Nectec

Full Paper Tutorial Short Paper Letters - Nectec

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

167Fig. 4. Room-temperature PR spectra as a function of the well thickness. The fittings of Eq. (1) to the PRspectra are shown by bright lines. The e(1)-hh(1) and e( 1)-lh(1) transition energies determinedby the fittings are indicated by arrows.The PR spectra as a function of photon energycan be analyzed using the familiar Aspnes thirdderivativefunction in the low electric fieldlimit’ 10 , i.e.,R piθn= Re∑ Cjej ( E − Egi+ iΓ−j)j=1∆(1)RHere, R is the reflectance, ∆R is the inducedchange in the reflectance by modulation light, Eis the photon energy, p is the total number ofspectral structures to be fitted,E ,Γ , C andθjare transition energy, broadening parameter,amplitude and phase, respectively, of the featurecorresponding to the j thgicritical point. Theparameter n is a factor used to specify the criticalpoint dimension.The energy levels associated with e(1)-hh(1) ande(l)-lh(1) transitions were determined by leastsquarefitting of Eq. (1) to PR spectra obtainedexperimentally. In this calculation, the n value forthe e(1)-hh(l) and e(1)-lh(1) features is 3, whilethe value is 5/2 for the band gap transition 11,12 .The resultant least-square fittings are also shownby bright lines in Fig. 4. The e(1)-hh(l) and e(1)-lh(1) transition energies obtained from thesefittings are shown by arrows in the figure. In Fig.5. The e(l)-hh(l) transition energies determinedfrom PR measurements are plotted by closedlozenges as a function of the well thickness,while open circles denote energy positions ofjjemission peaks observed in PL measurements.The transition energy decreases with increasingwell thickness. The e(l)-hh(1) transition energiesobtained from PR measurements agree quite wellwith PL results for all samples. Figure 6 showsthe well thickness dependence of the e(l)-lh(l)transition energies plotted by closed lozenges.The transition energy also decreases withincreasing well thickness, which is similar to thebehavior of the e(1)-hh(l) transition.We have made a simple calculation for quantumlevels in finite quantum wells. The onedimensionalSchrodinger equation for a finitesquare well was solved to obtain a stationarywave function. The e(1)-hh(1) and e(1)-lh(1)energies were calculated without considering anyother effects such as excitons and the Starkeffect. In the calculation, 0.73 eV and 1.35 eVwere used as room temperature band gaps forInGaAs and InP, respectively. The conductionbanddiscontinuity∆E c of 0.217 eV and valence-band discontinuity∆E v of 0.403 eV were applied 13 . The calculatedtransition energies are also plotted as a functionof the well thickness by closed circles for the e(1)-hh(1) transition in Fig. 5 and for the e(1)-lh(1) transition in Fig. 6. The behavior of measuredtransition energies agrees qualitatively with thetheoretical prediction, which decreases with the


168increasing well thickness. However, we observeda significant discrepancy between the measuredand the calculated values. The measured energiesare, in general, 50 meV below the calculatedenergies.Now we should discuss the origin of thediscrepancy in the transition energies determinedexperimentally and calculated theoretically. Thefirst possible candidate for the origin is the limitof our simple theory for the prediction of thetransition energies. Yamada et al., theoreticallystudied subband structure of the InP/InGaAs/InPSQWs using the envelope functionapproximation method taking into account bandnonparabolicity. 14 According to their calculation,nonparabolicity plays an important role in theInP/InGaAs/InP SQWs and experimental PLenergies for wide quantum wells are reasonablyexplained by this theory. For the well thicknessless than 5 nm, the PL energies are significantlylower than the theoretical results. Graduallyincreasing discrepancies with decreasing wellwidth is contradictory to the participation ofimpurities in the recombination process. Thepossibility of the participation of free excitons is,however, not excluded, since the half-widths ofPL spectra are relatively broad. But thediscrepancies seem to be somewhat larger thanthe binding energies of the exciton confined inthe InGaAs wells.Fig. 5.Dependence of transition energy e(1)-hh(1) on well thicknesses. Closed lozenges and opencircles show the PR and PL results, respectively. Closed circles show the calculated values.Fig. 6.Dependence of transition energy e(1)-lh(1) on well thicknesses. Closed lozengesshow the PR results. Closed circles show the calculated values.


169The second possible candidate for thediscrepancy is imperfection of the interfacesbetween InGaAs and InP. The dependence ofoptical properties of thin InP/InGaAs/InP SQWson the gas switching procedure during theOMVPE growth was reported by Bohrer et al 15 .In their study, they observed InAs 1-x P x , islands atInGaAs/InP interfaces, which were formed as aconsequence of the As-P exchange reaction. It isimportant to note that the islands exist at theinterfaces even in the sample prepared withcareful control of the gas switching procedure,although the phosphorous composition x of theInAs 1-x P x islands is influenced by the interruptiontime and the exchange efficiency of group-Velements depending on growth temperature.Based on their observation, existence of theimperfect InGaAs/InP interfaces is reasonablyassumed in our samples, resulting in deviationfrom the ideal square shape of the potential well.The deviation induces changes in well thickness,effective ∆E c and ∆E v and effective bulk bandgap of the well material. The resultant transitionenergies are obviously determined bycomplicated combination of these factors.Furthermore, the influence of the deviation worksmore significantly in the samples with the thinnerwell, because the fraction of the interface regionis larger in total volume of the well. X-ray crystaltruncation rod (CTR) scattering measurementsare now in progress on the samples to reveal theatomic-level InGaAs/InP heterointerfacestructures. Comprehensive discussion on a basisof the atomic-level structures will be describedelsewhere.5. ConclusionsPR measurements were used to investigateoptical transition energies in InP/InGaAs/InPSQWs with well thicknesses from 1 to 5 ML(from 0.3 to 1.5 nm) grown by a low-pressureOMVPE. The PR spectra clearly showed the e(l)-hh(1) and e(1)-lh(1) transitions in the SQWstogether with the band-to-band transition in theInP layers. Clear PR spectra indicate excellentoptical quality of these structures. The transitionenergies were determined by fitting the PRspectra to the theoretical line-shape expression.The resultant e(l)-hh(1) transition energies wereclose to energy positions of emission peaksobserved in PL measurements at roomtemperature. The e(1)-hh(1) and e(1)-lh(l)transition energies decreased with the increasingwell thickness. This behavior agreed qualitativelywith the theoretical prediction, although there is asignificant discrepancy in transition energies.AcknowledgmentsWe would like to record our sincere appreciationto Toray Thailand Science Foundation (TTSF)for the research grant for this study, ProfessorYoshikazu Takeda of Nagoya University for hisgifts of samples, advice and encouragement, andKing Mongkut's Institute of TechnologyLadkrabang for the research facilities.


170References[1] Y. Takeda, A. Sasaki, Y. Imamura, andT. Takagi, J. Appl. Phys. 47 (1976) 5405.[2] J. D. Oliver, Jr. and L. F. Eastman,J. Electron. Mater. 9 (1980) 693.[3] A. Sasaki, Y. Takeda, N. Shikagawa, andT. Takagi, Jpn. J. Appl. Phys., Supplement,16-1 (1977) 239.[4] H. Ohno, and J. Barnard, "GaInAsP AlloyConductors", edited by T. P. Pearsall (Wiley,New York, 1982), p. 437.[5] W. T. Tsang, Appl. Phys. Lett. 44 (1984) 288.[6] H. Temkin, K. Alavi, W. R. Wagner, T. P.Pearsall, and A. Y. Cho, Appl. Phys. Lett.42(1983) 845.[7] U.K. Reddy, G. Ji, T. Henderson, H. Morkoc,and J. N. Schulman, J. Appl. Phys. 62 (1987)145.[8] U. K. Reddy, G. Ji, T. Henderson, D. Huang,and R. Houdre, and H. Morkoc, J. Vac. Sci.Technol. BT (1989) 1106.[9] H. Yaguchi, X. Zhang, K. Ota, M. Nagahara,K. Onabe, Y. Shiraki, and R. Ito, Jpn. J. Appl.Phys. 32 (1993) 544.Z. Gumienmy, M. Panek, B. Sciana, andM. Tlaczala, Phys. Stat. Sol. (b) 183 (1994)143.[12] P. Basmaji, A. M. Ceschin, M. Siu Li,O. Hipolito, A. A. Bernussi, F. Iikawa, andP. Motisuke, Surf. Sci. 228 (1990) 356.[13] M. Nakao, S. Yoshida, and S. Gonda, SolidState Commun. 49 (1984) 663.[14] S. Yamada, A. Taguchi, and A.Sugimura,Appl.Phys.Lett.46 (1985) 675.[15] J. Bohrer, A. Krost, and D. Bimberg, Appl.Phys. Lett. 60 (1992) 2258.Jiti NukeawHe received B.Ed(Physics) fromSrinakarinwirot University,Songkla in 1983 and M.S.(Physics) from ChiangmaiUniversity in 1989 and D.Eng.(Material Sciencesand Engineering) from Nagoya University in1998. At present, his working as lecture atDepartment of Applied Physics, KMITL. Hiscurrent research interestsinclude Quantum Well Device, SemiconductorPhysics and Optical Instrumentation.[10] D. E. Aspnes, Surf. Sci. 37 (1973) 418.[11] Y. Misiewicz, P. Markiewicz, J. Rebisz,


Reducing Data Hazards on Multi-pipelined DSP Architecturewith Loop Scheduling £Sissades TongsimaNECTEC/HPCBkk, ThailandChantana ChantrapornchaiSilpakorn UniversityBkk, ThailandEdwin H.-M. ShaU. of Notre DameIndiana, USA.Nelson L. PassosMidwestern St.Texas, USA.Abstract—Computation intensive DSP applications usually require parallel/pipelined processors in order to meet specifictiming requirements. Data hazards are a major obstacle against the high performance of pipelined systems. This paperpresents a novel efficient loop scheduling algorithm that reduces data hazards for such DSP applications. This algorithmhas been embedded in a tool, called SHARP, which schedules a pipelined data flow graph to multiple pipelined unitswhile hiding the underlying data hazards and minimizing the execution time. This paper reports significant improvementfor some well-known benchmarks showing the efficiency of the scheduling algorithm and the flexibility of the simulationtool.º·¤Ñ´ÂˆÍ (parallel/pipelined processors) (data hazards) 1 IntroductionIn order to speedup current high performance DSP systems,multiple pipelining is an important strategy thatshould be explored. Nonetheless, it is well-known that oneof the major problems in applying the pipelining techniqueis the delay caused by dependencies between instructions,called hazards. Control hazards are known as the hazardsthat prevent the next instruction in the instruction streamfrom being executed, such as branch operations. Likewise,the hazards that encumber the next instruction by datadependencies are called data hazards. Most computationintensivescientific applications, such as image processing,and digital signal processing, contain a great number ofdata hazards and few or no control hazards. In this paper,we present a tool, called SHARP (Scheduling with HazardReduction for multiple Pipeline architecture), which wasdeveloped to obtain a short schedule while minimizing theunderlying data hazards by exploring loop pipelining anddifferent multiple pipeline architectures.Many computer vendors utilize a forwarding techniqueto reduce the number of data hazards in their architectures.This process is implemented in hardware whereby a copyof the computed result is sent back to the input prefetchbuffer of the processor. However, the larger the numberof forwarding buffers, the higher the cost that will be imposedon the hardware. Therefore, there exists a tradeoffbetween its implementation cost and the performancegain. Furthermore, many modern high speed computers,such as MIPS R8000, IBM Power2 RS/6000 and others,use multiple pipelined functional units (multi-pipelined) orsuperscalar (super)pipelined architectures. Providing a toolthat determines an appropriate pipelined architecture for agiven specific application, therefore, will be beneficial tocomputer architects. By using such a tool, one can finda suitable pipeline architecture that balances the hardwareand performance costs by varying the system architecture(e.g., a number of pipeline units, type of each unit, forwardingbuffers, etc.).Rearranging the execution sequence of tasks that belongto the computational application can reduce data hazardsand improve the performance. Dynamic scheduling£Reprint with permission from Kluwer Academic Publishers in the journal of VLSI signal processing, special issue on future directions in thedesign and implementation of DSP systems, Vol 18, 1998, pp 111-123


algorithms such as tomasulo and scoreboard are examplesof implementing the algorithms in hardware. They wereintroduced to minimize the underlying data hazards whichcan not be resolved by a compiler [16]. These techniques,however, increase the hardware complexity and costs.Therefore, special consideration should be given to staticscheduling, especially for some computation-intensive applications.The fundamental performance measurement ofa static scheduling algorithm is the total completion timein each iteration, also known as the schedule length. Agood algorithm must be able to maximize parallelism betweentasks and minimize the total completion time. Manyheuristics have been proposed to deal with this problem,such as ASAP scheduling, ALAP scheduling, critical pathscheduling and list scheduling algorithms [2, 3]. The criticalpath, list scheduling and graph decomposition heuristicshave been developed for scheduling acyclic data flowgraphs (DFGs) [7, 14]. These methods, however, do notconsider the parallelism and pipelining across iterations.Some studies propose scheduling algorithms to deal withcyclic graphs [5,15]. Nevertheless, these techniques do notaddress the issue of scheduling on pipelined machines thatexploit the use of forwarding techniques.Considerable research has been done in the area ofloop scheduling based on software pipelining—a fine-grainloop scheduling optimization method [6, 10, 12]. This approachapplies the unrolling technique which expands thetarget code segment. The problem size, however, alsoincreases proportionally to the unrolling factor. Iterativemodulo scheduling is another framework that has been implementedin some compilers [13]. Nonetheless, in orderto find an optimized schedule, this approach begins with aninfeasible initial schedule and has to reschedule every nodein the graph at each iteration.The target DSP applications usually contain iterative orrecursive code segments. Such segments are represented inour new model, called a pipeline data-flow graph (PDG).An example of a PDG is shown in Figure 1(b). In thismodel, nodes represent tasks that will be issued to a certaintype of pipeline and edges represent data dependenciesbetween two nodes. A weight on each edge refers to aminimum hazard cost or pipeline cost. This cost representsa required number of clock cycles that must occur in orderto schedule successive nodes. In this work, a proposednovel pipeline scheduling algorithm, SHARP, takes a PDGand some pipeline architecture specifications (e.g., pipelinedepth, number of forwarding buffers, type and number ofpipeline units etc.) as inputs. The algorithm then efficientlyschedules nodes from the PDG to the target system.After the initial schedule is computed, by a DAGscheduling algorithm such as list scheduling, the algorithmimplicitly uses retiming. Only a small number of nodes arerescheduled in each iteration of our algorithm. The newscheduling position is obtained by considering data dependenciesand loop carried dependencies, i.e., using looppipelining strategy as a basis to reduce data hazards whileimproving the total execution time under the hardware constraintsgiven by the user specifications.As an example, Figure 1(a) presents two pipeline architectureseach of which consists of five stages: instructionfetch (IF), instruction decode (ID), execution (EX), memoryaccess (M) and write-back (WR). For simplicity, assumethat each of these stages takes one clock cycle to finish[4]. The pipeline hazard in this case is 3, since withthis architecture, any instruction will put data available toread in the first half of the 5th stage (WR) and read it inthe 2nd stage (ID). In Section 2, we will explain how tocalculate this cost in more detail. The PDG and its correspondingcode segment to be executed in this two-pipelinesystem are shown in Figures 1(b) and (c) respectively. Noticethat each node of the graph also indicates the type ofinstruction required to be executed. Assume that the WRand ID stages of two dependent instructions can be overlapped.For example, instruction B can start reading (at theID stage) data produced by instruction A at the WR stage.A legal execution pattern of the pipeline for this exampleis illustrated in Figure 2(a).Since all the pipeline stages of issued instructionsare consecutive, only the beginning of each instructionpipeline is required to be shown. Figure 2(b) illustrates aschedule table resulting from Figure 2(b). This table onlyshows one iteration of the sample code segment (the completetable comprises of M 3 identical copies of this table).Such a schedule becomes an initial schedule whichcan be optimized by SHARP. Figure 3(a) and 3(b) showthe resulting intermediate PDG and schedule after applyingSHARP to the initial schedule. Nodes A and E fromthe next iteration are rescheduled to current iteration of theschedule. This is equivalent to retiming these nodes in thePDG (see Figure 3(a)). This technique explores the parallelismacross iterations (loop pipelining). SHARP repeatedlyapplies such a method to each intermediate schedule.Figures 3(c) and 3(d) show the third intermediate retimedPDG and its schedule respectively. At the third iterationwe obtain the optimized schedule with length 6 (a 25% improvementover the initial schedule).Using our tool, we obtain not only the reduced schedulelength but we can also evaluate other architecture options,such as introducing forwarding hardware in the architectureor even additional pipelines. In order to presentour algorithm, the remainder of this work is organized asfollows: Section 2 introduces some fundamental concepts.The main idea and theorems behind the algorithm used inSHARP are presented in Section 3. In Section 4, we discussthe experimental results obtained by applying differentpipeline architectures to this tool. Finally, Section 5


3AdderMultiplierIFIFIDRIDREXEXMMWRWWRWAE3B 3D3C333MultiplierAdderDelayFOR i = 4 TO M DO(A) A[i] = D[i-2] + 2(E) E[i] = D[i-2] * 2(B) B[i] = A[i] + 3(C) C[i] = A[i] + E[i](D) D[i] = B[i] * C[i](a) (b) (c)Figure 1: (a) Target pipeline architecture (b) Pipeline DFG (c) Corresponding code segmentControl steps1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16cs adder mult1 A E(A)* IF ID EX M WR2(E)* IF ID EX M WR34 B(B)+(C)+(D)*IF ID EX M WRIF ID EX M WRIF ID EX M WR567C(A)+IF ID EX M WR8 D(E)*IF ID EX M WR::::::(a)(b)Figure 2: (a) Pipeline execution pattern (b) An equivalent scheduleAE33 B 33C 333DMultiplierAdderDelaycs adder1 B2 CA34567multED: : :AE33 B 33C 333DMultiplierAdderDelaycs adder mult123AD456CB E: : :(a)(b) (c) (d)Figure 3: (a)-(b) PDG and schedule of intermediate step of the algorithm, (c)-(d) PDG and the schedule after third step


draws conclusions of this work.2 BackgroundA cyclic DFG, G VE, is commonly used to representdependencies between instructions in an iterative ora recursive loop. However, it does not reflect the type ofpipeline architecture to which the code segment is subjected.Therefore, in order to distinguish them, some commonhardware factors need to be considered.The type of architecture may be characterized by consideringdifferent types of pipelines in the system. Thenumber of stages in a pipeline, or pipeline depth, is oneconfiguration factor that is necessary to be taken into account,since it affects the overall pipeline speedup. Theforwarding hardware is also a factor because it can diminishthe data hazards. Furthermore, the system may consistof a number of forwarding buffers, responsible for howmany times a pipeline is able to bypass a datum [9].In this paper, we assume our algorithm guarantees thatno delays occur during the execution of one instruction. Inother words, the number of cycles from the execution of thefirst to the last pipeline stage for one instruction is equal tothe pipeline depth. In a multi-pipelined machine, if the executionof an instruction I 2 depends on the data generatedby instruction I 1 , and the starting moment of I 1 and I 2 aret 1 and t 2 respectively, we know that t 2 t 1 S out S in · 1,where S out is the index of the pipeline stage from which thedata is visible to the instruction I 2 ,andS in is the index ofpipeline stage that needs the result of I 1 in order to executeI 2 . We call S out S in · 1thepipeline cost of the edge connectingthe two nodes, representing instructions I 1 and I 2 .Figure 4 illustrates the concept of the pipeline cost. Such acost can be qualified in three possible situations dependingon the characteristics of the architecture:case 1: The pipeline architecture does not have a forwardingoption. The pipeline cost is similar to thedata hazard, which may be calculated from the differencebetween the pipeline depth and the numberof the overlapped pipeline stages. For example inFigure 4(a), this pipeline reads data at the end of IDand the data is ready after WR. The S out stage is 7and S in is 3. Hence, for this case, the pipeline cost is7 3·1 5.case 2: The pipeline architecture has an internal forwarding,i.e., data can merely be bypassed inside the samefunctional unit. The pipeline cost from this case maybe obtained in a similar way as above. For instance,the pipeline in Figure 4(b) has the internal forwardingsuch that the data will be available right after theEX stage. Then, S out is stage 5 and S in is stage 3,so the pipeline cost is 5 3 · 1 3. In this case,the special forwarding hardware is characterized intotwo sub-cases.1. The forwarding hardware has a limited numberof feedback buffers. The pipeline cost will bethe value without forwarding when all the forwardingbuffers are utilized.2. The forwarding hardware has an unlimitednumber of feedback buffers (bounded by thepipeline depth). In this case, the pipeline costwill always be the same.case 3: The pipeline architecture has an external or crossforwarding hardware, such as it is capable of passingdata from one pipeline to another pipeline. We calculatethe pipeline cost by the same way describedabove. Again, limited number of buffers or unlimitednumber of buffers are possible sub-cases.2.1 Graph ModelIn order to model the configuration of each multi-pipelinedmachine associated with the problem being scheduled, thepipeline data-flow graph is introduced.Definition 2.1 A pipeline data-flow graph (PDG) G VETdc is an edge-weighted directed graph, whereV is the set of nodes, E ¾ V ¢ V isthesetofdependenceedges, T is the pipeline type associated with a nodeu ¾ V, d is the number of delays between two nodes, andc´eµ´c fo c no µ is a function from E to the positive integersrepresenting the pipeline cost, associated with edge e ¾ E,where c fo and c no are the cost when considering with andwithout forwarding capability respectively.Each node in a PDG represents an instruction, and thetype of pipeline in which the instruction will be executed.An edge from node u to node v, exhibited by the notationu v, conveys that the instruction v depends on the resultfrom the instruction u. The number of delays d´eµ on anyedge e ¾ E such that u precedes v,whereuv ¾ V, indicatesa data dependence from node u to v, such that the executionof node v at iteration j relies on the data produced bynode u at iteration j d´eµ. The tuple associated with eachedge in a PDG, u ´c fo c noµ v, is architecture-dependent wherec fo is the number of clock cycles required when there existsa forwarding hardware, and c no is the number of clockcycles needed when executing the two instructions u and vconsidering no forwarding. If there is no forwarding hardware,the value of c fo will be the same as c no .As an example, Figure 5(a) illustrates a simple PDGassociated with two types of functional units, adder andmultiplier. Each of which is a five-stage pipeline architecturewith a forwarding function. Therefore, the pipeline


t1 t2 control stept1 t2 control stepI1I2S1 S2 S3 S4 S5 S6 Sout1 2 3 4 5 6 7Pipeline cost=5(a)S1 S2 Sin S4 S5 S6S71 2 3 4 5 6 7S1 S2 S3 S4 Sout S6 S71 2 3 4 5 6 7Pipeline cost=3(b)S1 S2 Sin S4 S5 S6 S71 2 3 4 5 6 7Figure 4: (a) Pipeline cost w/o forwarding hardware (b) Pipeline cost w/ forwarding capability1, 3 1,31,3BAC1,31,31,31,3 1,3D F E1, 3MultiplierAdder1,3adder mult.1 A2 B}c fo3 D4 C5 c no67 E8910 FABiteration 1 iteration 21 2 3 4 5 6+ A 1 B1 A2(a) (b) (c) (d)Figure 5: (a) Example when c fo 1andc no 3 (b) Corresponding initial schedule (c)-(d) PDG with inter-iterationdependency between node A and Bcost c fo 1andc no 3. Nodes ABCD,andF representthe addition instructions and node E indicates the multiplicationinstruction. The bar lines on D A and F Erepresent the number of delays between the nodes, i.e., twodelays on D A conveys that the execution of operationD at some iteration j produces the data required by A atiteration j · 2.2.2 Initial Scheduling in SHARPIn this subsection, we introduce some important considerationsin acquiring a static pipeline schedule from thePDG. Considerable research has been conducted in seekinga scheduling solution for a DFG [8]. In this research,we tailor the list scheduling heuristic so that it agrees withconditions of the PDG.A static schedule consists of multiple entries in a table.Each row entry indicates one clock cycle—the synchronizationtime interval, also called control step. Eachcolumn entry represents one of the pipeline units in themulti-pipelined system where nodes that have the samecorresponding types of pipeline will be assigned. Thefirst pipeline stage of each scheduled node starts executingwhenever the node appears in the table.In order to obtain a static schedule from a PDG feedbackedges (i.e., edges that contain delays) are temporarilyignored in this initial scheduling phase. For instance,D A and F E in Figure 5(a) are temporarily ignored.Our scheduling guarantees the resulting initial schedule islegal by satisfying the following properties. Further, thefollowing scheduling properties must be preserved by anyscheduling algorithm.Property 2.1 Scheduling properties for intra-iteration dependencies1. For any node n preceded by nodes m i by edges e i´c foi c noi µsuch that d´e i µ0 and m i n. If ×´m i µ is thecontrol step to which m i was scheduled and b i is thenumber of available buffers for the functional unitrequired by m i , then node n can be scheduled at anycontrol step ´csµ that satisfies the following rules.wherecs max×´m i µ·cost´b i µi´cost´b i µc fo if b i 0cost´b i µc nootherwise2. If there is no direct-dependent edge between nodesq and r, i.e. d´eµ 0, and q is scheduled to controlstep k, node r may be placed at any unoccupied controlstep which does not conflict with any other datadependency constraints.Note that if the architecture does not use forwarding hardware,then we set c fo c no and b i 0. As an example,Figure 5(b) presents the resulting schedule table whenwe schedule the graph shown in Figure 5(a) to a multiplepipelined system consisting of one adder and one multiplierwith one internal buffer for each unit.The last step of initial scheduling is to check the interiterationdependency which is implicitly represented by the


feedback edges of the PDG. A certain amount of emptycontrol steps has to be preserved at the end of the scheduletable if the number of control steps between two interdependentnodes belonging to different iterations is not sufficientto satisfy the required pipeline cost of the two correspondinginstructions. Figures 5(c) and (d) illustrates thissituation. Assume that the pipeline depth of the adder is5. If we did not consider the feedback edge, the schedulelength would be only 4. However, the schedule lengthactually has to be 6 since node A in the next iteration, representedby A 2 , cannot be assigned to the control step rightafter node B 1 due to the inter-iteration dependency betweennodes A and B. Hence two empty control steps need tobe inserted at the end of this initial schedule and the finalschedule length becomes six rather than four.Note again that the execution of all pipeline stages, exceptfor the first one, of any scheduled node are hidden inan initial schedule table. Those stages are overlapped andonly the first stage of each node is displayed, e.g., see Figure2(a). After applying a list scheduling algorithm thatenforces Property 2.1 to the example in Figure 1, the initialschedule of Figure 2(b) is produced. The static schedulelength for that case is 8.3 Reducing Schedule LengthIn the previous section, we discussed the scheduling conditionsfor assigning nodes from a PDG to a schedule table.These conditions are also applied to the optimizationprocess of our algorithm. Our algorithm is able to reducethe underlying static schedule length of an initial schedulepreviously obtained. It explores the parallelism across iterationsby implicitly employing the retiming technique [11].The following section briefly reviews the retiming and rotationtechniques.3.1 Retiming and RotationThe retiming technique is a commonly used tool for optimizingsynchronous systems. A retiming r is a functionfrom V to Z. The value of this function, when applied toa node v, is the number of delays taken from all incomingedges of v and moved to its outgoing edges. An illegalretiming function occurs when one of the retimed edge delaysbecomes negative. This situation implies a referenceto a non-available data from a future iteration. Therefore, ifwe consider G r VETd r c to be a PDG G retimed bya function r, a retiming is legal if the retimed delay countd r is nonnegative for every edge in E. For an edge u v,the number of additional delays is equal to the number ofdelays moved to the edge through node u, subtracted by thenumber of delays drawn out from the edge through node v.The retiming technique can be summarized by the followingproperties:Property 3.1 Let G r VETd r c be a PDG G VETdc retimed by r.1. r is a legal retiming if d r´eµ 0 for every e ¾ E.2. For any edge u e v, we have d r´eµd´eµ·r´uµr´vµ.3. For any path u p v, we have d r´pµd´pµ·r´uµr´vµ.4. For a loop l, we have d r´lµd´lµ.Property 3.1 demonstrates how the retiming methodoperates on a PDG. An example of retiming is shown inFigure 6. The retiming r´Aµ1 conveys that one delay isdrawn from the incoming edge of node A and pushed to allof its outgoing edges, A B and A C.After a graph has been retimed, a prologue is the setof instructions that must be executed to provide the necessarydata for the iterative process. In our example, theinstruction A becomes the prologue. An epilogue is theother extreme, where a complementary set of instructionswill need to be executed to complete the process. The timerequired to run the prologue and epilogue is assumed to benegligible when compared to the total computation time ofthe problem.Chao, LaPaugh and Sha proposed a flexible algorithm,called rotation scheduling, to deal with scheduling a DFGunder resource constraints [1]. Like its name, this algorithmanalogously moves nodes from the top of a scheduletable to its bottom. The algorithm essentially shifts the iterationboundary of the static schedule down, so that nodesfrom the next iteration can be explored. We now introducesome necessary terminology and concepts used in this paper.Definition 3.1 Given a PDG G VETdc and R V,the rotation of R moves one delay from every incomingedge to all outgoing edges of nodes in R. The PDG nowis transformed into a new graph (G R ).For a schedule table with length L, this definition isapplicable when moving the first row of the schedule tableto the position L·1. Therefore, this operation implicitlyretimes the graph. The benefit of doing the rotationis that a few number of nodes are rescheduled. Thereforeonly a small part of an input graph is modified instead ofrescheduling the whole graph. Rotation scheduling mustpreserve the following property:Property 3.2 Let G VETdc be a PDG and R V.A set R can be legally retimed if and only if every edge fromV R to R contains at least one delay.


33AE3B 3D3C333MultiplierAdderDelayAE3 B 33C 333DMultiplierAdderDelay(a)(b)Figure 6: An example of retiming data-flow graph (a) Original (b) When r´Aµ1This property implies that the rotation operation alwayspreserves Property 3.1. After performing the rotation strategy,the dependencies in a new graph are changed, sincesome delays in the graph are now moved to new edges.This allows us to explore the possibility of parallelizingthose nodes that do not have a direct-dependent edge fromtheir predecessors. Carefully re-scheduling those rotatednodes to new positions, the schedule length can be decreased.Nevertheless, as mentioned earlier, we also have toconsider the inter-iteration dependency. Hence a newschedule position assignment for a node has to be carefullychosen to avoid conflicts in the dependency constraint betweeniterations. Finding a valid scheduling position nowbecomes more complex since the problem now has incorporatedpipeline hazards. The major different from the traditionalalgorithm is that our algorithm requires checkingnot only dependencies of the new graph after rotating anode but also pipeline hazards which may occur only ifschedule a node to different processors. The following sectiondiscusses how to find such a dependency and avoidingthe underlying pipeline hazards in detail.3.2 Minimum Schedule LengthWe know that a number of delays on any edge u v,where uv ¾ V, indicates in which iteration, prior to thecurrent iteration, node u legally produces data for node v.This conveys that in order to schedule the rotated nodes,the pipeline cost constraints must also be satisfied, e.g., theinter-iteration dependency between nodes u and v.Definition 3.2 Given a PDG G VETdc and nodesuv ¾ Vwhereu v ¾ E, the minimum schedule lengthwith respect to nodes u and v, ML´uvµ, is the minimumschedule length required to comply with all data-dependentconstraints.The following theorem presents the ML function.Theorem 1 Given a PDG G VETdc, anedgeeu v ¾ E, and d´eµkfork 0, a legal schedule lengthfor G must be greater than or equal to ML´uvµ, whereML´uvµ pipe cost·cs´uµ cs´vµwith cs´nodeµ being the starting control step of that nodeand pipe cost is either c no or c fo depending on the architecture.Proof: Let L be the schedule length for one iteration. Weknow that the minimum number of control steps betweennode u at iteration j and node v at iteration j · k is thepipeline cost associated with u v. There are k 1 iterationsbetween iterations j and j · k. Since all iterationshave the same length L, the following equation isthe relationship of the distance between cs´uµ and cs´vµ:L ¢´k 1µ·´L cs´uµµ·cs´vµ·∆ pipe cost where ∆represents a number of compensated control steps fulfillingthe pipeline cost requirement. Hence, ∆ can be expressedas: ∆ pipe cost L ¢´k 1µ L·cs´uµ cs´vµ. Inorderto obtain a uniform schedule, ∆ is distributed over all kiterations preceding iteration i·k. This distribution resultsin a minimum value δ ∆ k, and the new static schedulelength that satisfies the constraints with respect to u isML δ·L. After substituting, we obtain pipe cost·cs´uµ cs´vµML´uvµSince a node may have more than one predecessor, inorder to have a legal schedule length, one must consider themaximum value of ML. In other words, the longest schedulelength that is produced by computing this function willbe the worst case that can satisfy all predecessors.3.3 AlgorithmThe scheduling algorithm used in SHARP applies the MLfunction to check if a node can legally be scheduled at aspecific position. Therefore, it may happen that the obtainedschedule will require some empty slots to be addedto compensate for the inter-iteration dependency situation.We summarize this algorithm in Figures 7 which demonstrateshow we utilize the two important optimization functionsPipe rotate and Re-schedule in SHARP. Note againkk


INPUT : ´Î Ìdcµ, # forwarding buffers, and # pipelinesOUTPUT : shortest schedule table SbeginS : Start-Up-Schedule´µ; Q : S;for i : 1 to Î step 1 do´Sµ : Pipe rotate´µ;if length´Sµ length´Qµ then Q : S; fi odproc Pipe rotate´Sµ N : Deallocate´Sµ; /* extract nodes from the table */r : Retime´Nµ; /* operate retiming technique on the nodes */S : Re-schedule´SNµ;return´rSµ .proc Re-schedule´SNµ foreach v ¾ N docs min : maxparents´vµcs · cost´parent´vµb i µ;cs max : length´Sµ; /* get an upper bound schedule length */cs : cs min;/* find a minimum available legal control step to schedule v */while ´cs cs maxµ ´´legal´csv µfalseµ ´´pid : entry´Scsµµ not availableµµ docs ··; odif cs cs maxthen assign´Svcs maxvpidµ; /* assign at the same pid */else assign´Svcspidµ; fi/* assign at the obtained pid*/odreturn´Sµ .endFigure 7: The SHARP framework: showing how the optimization functions play their roles


that the initial schedule in the algorithm can be obtainedby any DAG scheduling algorithm, e.g., a modified listscheduling that satisfies Property 2.1. Next, the procedurePipe rotate is applied to shorten the initial scheduletable. It first deallocates nodes from the schedule table.These nodes are then retimed and consequently rescheduled.The procedure Re-schedule finds a proper positionsuch that the schedule length will not exceed the previouslength. A scheduling position has to satisfy Property 2.1and Theorem 1. This process is computed in the while loop(Lines 8–10) which calculates an appropriate control stepconsidering a pipeline cost and buffer size as well as ML.Then, if the obtained control step is smaller than the currentone and a required unit is available, the node can bere-scheduled. Otherwise, it remains at the same position.As a result, the new schedule table can either be shorter orhave the same length.Consider now the PDG shown in Figure 8. Inthis example, there are 5 addition-instructions and 1multiplication-instruction. Assume that the target architectureis similar to the one presented in the introductionsection (i.e., one adder and one multiplier with one-bufferinternal forwarding). After obtaining the initial schedule,shown in Figure 8(b), the algorithm attempts to reduce theschedule length by calling the function Pipe rotate whichbrings A from the next iteration, called A 1 , and re-scheduleit to cs5 (whichiscs4 after re-numbering the table) of theaddition unit. By doing so, the forward buffer of A, whichwas granted to B in the initial schedule, is free since thisnew A 1 does not produce any data for B. Then, the staticschedule length becomes 9 control steps. After runningSHARP for 4 iterations, the schedule length is reduced tosix control steps as illustrated in Figure 8(c).4 Experimental ResultsWe have used SHARP in experiment on several benchmarkswith different hardware assumptions: no forwarding,one buffer-internal forwarding, sufficient bufferinternalforwarding (in-frw.), one buffer-external forwarding,two buffer-external forwarding and sufficient bufferexternalforwarding (ex-frw.). The target architecture iscomprised of a 5-stage adder and a 6-stage multiplierpipeline units. When the forwarding feature exists, thedata produced at the end of the EX-stage can be forwardedto the next execution cycle of EX-stage as shown in Figure4(a).Note that the sufficient-xx forwarding assumption conveysthat its architecture has sufficient number of forwardingbuffers. Furthermore, the internal and external modifiersfor each assumption convey that the forwarding techniquecan be done within one functional unit and betweentwo functional units respectively. The set of benchmarkproblems and their characteristics are shown in Figure 4(b)Tables 1 and 2 exhibits the simulation results from a systemthat contains one adder/one multiplier and 2 adders/2multipliers respectively. Note that the results presented inthese tables were collected after running SHARP againsteach benchmark until there is no improvements for 7 consecutiveintermediate schedules (i.e., seven iterations of thealgorithm). Both tables present an initial schedule length ofeach benchmark and the final length after applying the algorithmto the initial schedule (see column int/aft). The reductionpercentage of each benchmark is presented in column%.From experiments, the performance of the one bufferinternalforwarding scheme is very close to the sufficientbuffer-internal forwarding one. This is because most ofthe selected benchmarks have only one or two outgoingedge(s) (fan-out degree) for each node. Increasing thenumber of internal forwarding buffers may slightly increaseperformance. The performance of a system with onebuffer could be worse than the one with sufficient buffersfor some applications with large fan-out degrees. In thiscase, only one successive node can be scheduled earlierby consuming the data from an only buffer and the restof the successive nodes would cause the underlying datadependenthazards, i.e., waiting for data being ready fromits parent at WR-stage. For a system with external forwarding,data can be forwarded to any functional unit in thesystem. Therefore, the resulting schedule length is shorterthan that of the system with internal forwarding capability.Selecting an appropriate number of buffers depends onthe maximum fan-out degree and the pipeline depth. Insome cases only one or two buffers are enough with additionalbuffers not producing a significant improvement.As an example, consider column 4 of Table 1 which describesa system with external forwarding. Particularlyfor the wave digital filter application (benchmark 4) usingonly one buffer is the most appropriate since the algorithmresults in the maximum reduction, 33%, over theinitial schedule length. Adding 2 or more buffers resultsin an 11% reduction. For the differential equation solverapplication (benchmark 2), selecting two buffers is a goodchoice since the algorithm yields the maximum reduction.The number of available units is also another signifi-


1, 3 1,3B1,3MultiplierAdderA1,31,31,3 1,3D F E1, 3C1,31,3cs + *ABD C1234567891011121314151617181920FA 1B 1D 1 C 1EEF 11cs + *ABD C1234567891011121314151617181920FA1B1D 1 C 1EEF 11cs + *1 B2 D3 C4 A 156 E789 F10 B111 D112 C 113 A21415 E1161718 F1cs + *1 A2 B3 D E4 C56 F(a) (b) (c)Figure 8: (a) The 6-node PDG (b) the first optimized schedule table and (c) the final scheduleAdderMultiplierIF ID EX M WRIF ID EX M WRIF ID EX EX M WRIF ID EX EX M(a)WRBenchmark Mul Add Sum1. 5-th Order Elliptic Filter 8 26 342. Differential Equation Solver 6 5 113. All-pole Lattice Filter 11 4 154. WDF for Transmission Line Computation 4 8 125. Unfolded All-pole Lattice Filter (uf=7) 66 24 906. Unfolded Differential Equa. Solver (uf=5) 24 20 447. Unfolded 5-th Elliptic Filter (uf=2) 16 52 68(b)Figure 9: (a) 5-stage adder with internal forwarding unit and 6-stage multiplier with internal forwarding unit (b) Characteristicsof the benchmarksBen. no-frw. 1 buf/in-frw. in-frw. 1 buf/ex-frw. 2 buf/ex-frw. ex-frw.int/ aft % int/ aft % int/aft % int/aft % int/aft % int/aft %1 58/56 2 43/42 2 43/42 2 29/28 3 29/28 3 29/28 32 20/17 15 18/15 17 18/15 17 14/13 7 14/12 14 12/ 11 83 50/29 42 43/24 44 42/24 42 24/14 42 15/12 20 15/12 204 25/ 8 68 24/8 67 22/8 64 12/ 8 33 9/8 11 9/8 115 191/ 150 21 164/145 12 164/145 12 89/83 7 70/67 4 70/67 46 76/63 13 54/30 44 53/28 47 31/24 23 28/24 14 27/24 117 115/ 111 4 84/80 5 84/80 5 57/52 9 54/52 4 54/52 4Table 1: Performance comparison for 1 adder and 1 multiplier system


cant criterion. Since most of the tested applications requiremore than one addition and one multiplication, increasingthe number of functional units can reduce the underlyingcompletion time. Doubling the number of adders and multipliersmakes the initial schedule length shorter than thatof the single functional unit version. According to the resultpresented in Table 1, for the system with an externalforwarding hardware, processing a large application, suchas the unfolded elliptic filter, the adder unit is occupied atalmost every control step. Adding more functional units isthe only approach that would reduce the schedule length.Table 2 shows the experimental results for the system with2 multipliers and 2 adders.According to the data from Table 2, even though wehave added more functional units to the target system thehazard reduction percentage (ranging from 2–80 %) stillrelies on the characteristic of the applications as well as thepipeline architectures. For example, without the forwardingfeature, in the lattice filter application, hazards can bereduced up to 45 percent in the 2-adder and 2-multipliersystem. For the wave digital filter (benchmark 4), the reductionis 80%.The experimental results from both tables show thatSHARP can reduce a large number of hazards by consideringall available hardware and overlapping pipeline instructions.Further, in each iteration of SHARP, the algorithmonly needs to reschedule a few number of nodes. Our algorithmcan also help designers choose the appropriate hardwarearchitecture, such as the number of pipelines, pipelinedepth, the number of forwarding buffers and others, in orderto obtain good performance when running applicationssubject to their overhead hardware costs.5 ConclusionSince computation-intensive applications contain a significantnumber of data dependencies and few or no controlinstructions, data hazards often occur during the executiontime which degrades the system performance. Hence, reducingthe data hazards can dramatically improve the totalcomputation time of such applications. Our algorithm,SHARP, supports modern multiple pipelined architecturesand applies the loop pipelining technique to improve thesystem output. It takes the application characteristics inthe form of a pipeline data-flow graph and target systeminformation (e.g., the number of pipelines and depth, theirassociated types, and their forwarding buffer mechanism)as inputs. SHARP reduces data hazards by rearrangingthe execution sequence of the instructions and produces aschedule in accordance with the system constraints. Notonly does SHARP serve as a scheduling optimization tool,it can be a simulation tool for a system designer as well.References[1] L. Chao, A. LaPaugh, and E. Sha. Rotation Scheduling:A Loop Pipelining Algorithm. In Proceedingsof ACM/IEEE Design Automation Conference, pages566–572, June 1993.[2] S. Davidson, D. Landskov, et al. Some Experimentsin Local Microcode Compaction for Horizontal Machines.IEEE Transactions on Computers, c-30:460–477, July 1981.[3] D. D. Gajski, N. D. Dutt, A. C-H Wu, and S. Y-LLin. High-Level Synthesis: Introduction to Chip andSystem Design. Kluwer Academic Publishers, 1992.[4] J. L. Hennesy and D. A. Patterson. Computer ArchitectureA Quantitative Approach. Morgan and KaufmannPublisher Inc., California, 1990.[5] P. D. Hoang and J. M. Rabaey. Scheduling ofDSP Programs onto Multiprocessors for MaximumThroughput. IEEE Transactions on Signal Processing,41(6), June 1993.[6] R. B. Jones and V. H. Allan. Software Pipelining:An Evaluation of Enhanced Pipelining. In Proceedingsof the 24th Annual International Symposium onMicroarchitecture, volume 24, pages 82–92, 1991.[7] R.A.Kamin,G.B.Adams,andP.K.Dubey. DynamicList-Scheduling with Finite Resources. In InternationalConference on Computer Design, pages140–144, Oct. 1994.[8] A. A. Khan, C. L. McCreary, and M. S. Jones. AComparison of Multiprocessor Scheduling Heuristics.In 1994 International Conference on ParallelProcessing, volume II, pages 243–250. IEEE, 1994.[9] P. M. Kogge. The Architecture of Pipelined Computers.McGraw-Hill, New York, 1981.[10] M. Lam. Software Pipelining. In Proceedings of theACM SIGPLAN’88 Conference on Progaming LanguageDesign and Implementation, pages 318–328,June 1988.


Ben. no-frw. 1 buf/in-frw. in-frw. 1 buf/ex-frw. 2 buf/ex-frw. ex-frw.int/ aft % int/ aft % int/aft % int/aft % int/aft % int/aft %1 57/56 2 39/38 3 37/36 3 18/17 5 18/17 5 18/17 52 19/18 5 16/15 6 16/15 6 12/11 8 9/8 11 9/8 113 49/27 45 40/23 43 40/23 43 24/11 54 12/9 25 12/9 254 23/5 78 23/4 83 21/4 81 11/6 46 6/4 33 6/4 335 180/158 12 155/136 12 155/136 12 76/69 9 47/44 6 47/44 66 73/67 8 49/42 14 49/41 16 23/16 30 19/13 32 18/13 277 114/112 2 77/74 3 75/73 3 39/37 5 32/31 3 31/30 3Table 2: Performance comparison for 2-adder and 2-multiplier system[11] C. Leiserson and J. Saxe. Retiming Synchronous Circuitry.Algorithmica, pages 5–35, June 1991.[12] K. K. Parhi and D. G. Messerschmitt. Static rateoptimalscheduling of iterative data-flow programsvia optimum unfolding. In Proceedings of the InternationalConference on Parallel Processing, volumeI, pages 209–216, 1989.[13] B. Ramakrishna Rau. Iterative Modulo Scheduling:An Algorithm For Software Pipelining Loops. InProc. 27th Annual International Symposium on Microarchtecture,pages 63–74, November 1994.[14] B. Shirazi et al. PARSA: A PARallel programScheduling and Assessment environment. In InternationalConference on Parallel Processing, 1993.[15] S. Shukla and B. Little. A Compile-time Techniquefor Controlling Real-time Execution of Task-levelData-flow Graphs. In 1992 International Conferenceon Parallel Processing, volume II, 1992.[16] R. M. Tomasulo. An Efficient Algorithm for ExploitingMultiple Arithmetic Units. IBM Journal of Researchand Development, 11(1):25–33, January 1967.Sissades Tongsima was born in Bangkok, Thailand, on January1, 1970. He received the B.Eng degree in Industrial InstrumentalEngineering in 1991 from the King Mongkut Instituteof Technology (Ladkrabang) Thailand. In 1992, hewas awarded the Royal Thai Government Scholarships topursue his study in Computer Science majoring in paralleland distributed computing area. He obtained his M.S. andPh.D. degrees from the department of Computer Scienceand Engineering, University of Notre Dame in 1995 and1999 respectively. Dr. Tongsima research interests whilestudying at Notre Dame include data scheduling and partitioningon parallel and distributed systems, high-level synthesis,loop transformations, rapid prototyping, and fuzzysystems. Upon the completion of his study, he came backto Thailand. Since June 1999, Dr. Tongsima has joinedthe National Electronics and Computer Technology Center(NECTEC). He is currently a researcher of the HighPerformance Computing Division at NECTEC.Chantana Chantrapornchai received her Ph.D. degree inComputer Science and Engineering, University of NotreDame, USA. in 1999. She received her bachelor degree inComputer Science from Thammasat University, Bangkok,Thailand in 1992 and M.S. degree in Computer Sciencefrom Northeastern University, Boston, Massachusetts in1994. Currently Dr. Chantrapornchai is a faculty memberin Department of Mathematics, Faculty of Science,Silpakorn University, Thailand. Her research interests includehigh-level synthesis, rapid prototyping, and fuzzysystems.Edwin H.-M. Sha (S’88-M’92) received the M.A. and Ph.D. degreefrom the Department of Computer Science, PrincetonUniversity, Princeton, NJ, in 1991 and 1992, respectively.Since August 1992, he has been with University of NotreDame, Notre Dame, IN. He is now an associate professorand the Associate Chairman of the Department of ComputerScience and Engineering.His research areas include Multimedia, Memory systems,Parallel and pipelined architectures, Loop transformationsand parallelizations, Software tools for parallel and distributedsystems, High-Level synthesis in VLSI, Faulttolerantcomputing, VLSI processor arrays, and Hardwareand software co-design.He has published more than 100 research papers in referredconferences and journals during the past sevenyears. He is actively participating in professional activities.In 1994, He was the Program Committee Chairfor the Fourth IEEE Great Lakes Symposium on VLSIand he served as the Program Committee Co-Chair forthe 2000 ISCA 13th International Conference on Paralleland Distributed Computing Systems. He also servedin program committee for many international conferencessuch as IEEE International Symposium on the Frontiers ofMassively Parallel Computation,IEEE/ACM InternationalSymposium on System Synthesis, and International Conferenceon Parallel and Distributed Computing and Systems,etc. He has been served as an associate editor forseveral journals. He received Oak Ridge Association Ju-


nior Faculty Enhancement Award in 1994, and NSF CA-REER Award in 1995. He is also invited to be a guesteditor for the special issue on Low Power Design of IEEETransactions on VLSI Systems and is now serving as aneditor for IEEE Transactions on Signal Processing. He receivedCSE Undergraduate Teaching award in 1998.Nelson L. Passos: received the B.S. degree in electrical engineering,with specialization in telecommunications, fromthe University of Sao Paulo, Brazil, in 1974. He receivedthe M.S. degree in Computer Science from the Universityof North Dakota, Grand Forks, ND, in 1992, and thePh.D. degree in Computer Science and Engineering fromthe University of Notre Dame, IN in 1996.From 1974 to 1990, he worked at Control Data Corporation.Since 1996 he has been at Midwestern State University,Wichita Falls, TX, where he is currently an AssociateProfessor with the Department of Computer Science.His research interests include parallel processing,VLSI design, loop transformations, high-level synthesis,and multi-dimensional digital signal processing.Dr. Passos was awarded the Professional Excellence andBill Norris Shark Club Awards at Control Data Corporation.While with the Universoty of Notre Dame, he wasawarded the William D. Mensch, Jr. Fellowship. He receivedan NSF grant award in 1997 on support to new researchon multidimensional retiming.


184แนะนํ า UML เบื้องตนดร.บรรจง หะรังษี และ นางญาณวรรณ สินธุภิญโญนักวิจัย งานโครงการเครือขาย NECTECNetศูนยเทคโนโลยีอิเล็กทรอนิกสและคอมพิวเตอรแหงชาติABSTRACT -- UML is a new wave in the software industry that has continued to grow upday by day and year by year. Currently it is widely said among system analysts, programmers,software engineers and software-related people, of applying the UML methodology to officeand organization applications. For those who are interested in the software engineeringprocess, this tutorial article is aimed at introducing the basics of UML: What is UML? andWhat are the fundamental working mechanisms of UML? In addition it is highly hoped in theend that this article will do a certain degree, assist those people in making a decision whetherto bring UML to use with your office or not.บทคัดยอ-- UML เปนคลื่นลูกใหมมาแรงในแวดวงอุตสาหกรรมซอฟตแวร ซึ่งมีการเติบโตขึ้นเรื่อยๆ อยางดีวันดีคืน ปจจุบันในแวดวงนักวิเคราะหระบบ โปรแกรมเมอร หรือผูที่ทํ างานเกี่ยวกับซอฟตแวรเปนที่กลาวกันอยางแพรหลายถึงการนํ าเอา UML มาประยุกตใชกับระบบงานตางๆ ในสํ านักงานหรือองคกรของตน บทความ <strong>Tutorial</strong> ฉบับนี้มีจุดมุงหมายที่จะแนะนํ าโดยเบื้องตนวา UML คืออะไรและมีกลไกการทํ างานโดยพื้นฐานอยางไร เพื่อใหบุคคลที่เกี่ยวของโดยเฉพาะทางดานซอฟตแวรไดทราบและเรียนรูถึงภาพโดยรวมของUML นอกจากนั้นแลวผูเขียนยังหวังวาบทความนี้อาจจะมีสวนชวยในการตัดสินใจถึงการที่จะนํ าเอา UML มาใชกับหนวยงานของทานหรือไมคํ าสํ าคัญ -- Software Methodology, Modeling Language, Object-Oriented Analysis andDesign, UML, Object-Oriented Programming, Software Engineering, Software Development,System Analysis and Design----------------------------------------------------------------------------------------------------------------------------------------ผูอานหลายทานคงไดคุนหูถึงคํ าวา UML หรือUnified Modeling Language และคงไมแนใจวาUML คืออะไร จะนํ าไปใชงานไดอยางไร บทความนี้ผูเขียนจึงอยากจะแนะนํ าใหผูอานรูจักและเขาใจถึง UML ในแงมุมตางๆ ดังนี้• นิยามของ UML และทํ าไมเราตองใช UML• กลไกการทํ างานเบื้องตนของ UML วามีองคประกอบอะไรบาง• ภาพโดยรวมของกระบวนการทํ างานทั้งหมดของ UML1. UML คืออะไรการดํ าเนินงานโครงการพัฒนาซอฟตแวรประกอบดวย การเก็บรวมรวมขอมูลเกี่ยวกับความตองการของผูใช (Requirement Collection)ในการใชระบบ การวิเคราะหขอมูลเหลานั้น(Analysis) การออกแบบ (Design) และการเขียน


โปรแกรมหรือการสรางซอฟตแวร (Implementation)เปนงานศิลปะประเภทหนึ่ง ที่มีความละเอียดออน เพราะตองการความพิถีพิถันในทุกขั้นตอนนับตั้งแตการวิเคราะหขอมูลที่ไดรับจนกระทั่งการพัฒนาขึ้นมาเปนซอฟตแวร (ระบบ คือซอฟตแวรที่เราจะทํ าการพัฒนาขึ้นมาใช)จุดนี้จึงเกิดเปนคํ าถามวาเราจะมีวิธีการหรือเครื่องมือที่ดีอันหนึ่งหรือไม ที่จะชวยใหการดํ าเนินงานโครงการทํ าซอฟตแวรโครงการหนึ่งเปนไปอยางมีประสิทธิภาพ ประสิทธิผล และมีการประสานกลมกลืนนับตั้งแตตนจนจบ คํ าตอบก็คือ "มี" และUML ก็คือเครื่องมือซึ่งสามารถ "ชวย" เราไดนับตั้งแตการวิเคราะห การออกแบบ และการดํ าเนินการพัฒนาตัว UML จริงๆ แลวไมสามารถดํ าเนินการสรางซอฟตแวรได กลาวคือ ไมสามารถทํ าการสรางโปรแกรมได (Code Generation) แตทวาผลพวงภายหลังจากการออกแบบมีรูปแบบหรือหนาตาที่โปรแกรมเมอรสามารถที่จะดํ าเนินการพัฒนาโปรแกรม (Coding) ไดอยางเร็วและงายดายมากUML มององคประกอบตางๆ ของซอฟตแวรที่จะทํ าการพัฒนาขึ้นมาในรูปของออบเจ็คต (Object)[1] และออบเจ็คตแตละตัวนั้นมีความเกี่ยวของกันโดยอาศัยความสัมพันธ(Relationships) เปนตัวเชื่อมโยง อีกทั้งออบเจ็คตเหลานั้นสามารถติดตอสื่อสารกันได การติดตอสื่อสารกันระหวางออบเจ็คตนี้เองเปนกลไกภายในซอฟตแวรที่ทํ าใหซอฟตแวรทํ างานตามที่ผูใชตองการไดจากการมองซอฟตแวรเปนออบเจ็คต นี่เองUML จึงชวยใหการเขียนโปรแกรมเชิงวัตถุ(Object-Oriented Programming) เปนไปไดงายเพราะการเขียนโปรแกรมเชิงวัตถุก็มององคประกอบของซอฟตแวรเปนออบเจ็คตเชนเดียวกัน1.1 ประวัติโดยยอของ UMLอาจจะมีคํ าถามหนึ่งที่วา UML เปนวิธีการเดียวหรือไมที่สามารถนํ ามาประยุกตใชในการดํ าเนินงานโครงการทํ าซอฟตแวร คํ าตอบก็คือ ยังมีวิธี185การอื่นๆ อีกหลายวิธีที่เกิดขึ้นมาในชวงประมาณ20 ปที่ผานมา ซึ่งแตละวิธีมีทั้งจุดออนและจุดแข็งที่แตกตางกันไป แตทวามีอยู 4 วิธีการตอไปนี้ซึ่งเปนตัวที่เดนและเปนที่รูจักกันดีในแวดวงอุตสาหกรรมซอฟตแวร• วิธีการของ Booch• วิธีการ Object ModelingTechnique (OMT)• วิธีการ Object-Oriented SoftwareEngineering (OOSE)• วิธีการของ Coad และ Yourdonในป 1994 ผูนํ าของ 3 คายคือ Grady Booch (วิธีการของ Booch), James Rumbaught (วิธีการOMT) และ Ivar Jacobson (วิธีการ OOSE) ไดรวมมือกันและเริ่มตนกระบวนการผสานวิธีการทั้งสามเขาเปนหนึ่งเดียว (Unified) และจุดนี้จึงเกิดเปนจุดกํ าเนิดของ Unified ModelingLanguage หรือ UML นั่นเองนับแตนั้นเปนตนมาจึงมีการรวมมือกันของกลุมบริษัทตางๆ ทั้งในอุตสาหกรรมซอฟตแวรและคอมพิวเตอร โดยมีแกนนํ าคือ Rational SoftwareCooperation และในป ค.ศ. 1997 UML เวอรชัน1.1 ก็ถือกํ าเนิดขึ้นมาและไดรับการยอมรับใหเปนมาตรฐานอุตสาหกรรมซอฟตแวรนับจากนั้นเปนตนมากลุมของบริษัทยักษใหญที่เขามารวมตัวกันเปนสมาชิกในการรวมพัฒนา UML ประกอบไปดวยMicrosoft, IBM, Oracle, Sun และ Compaq ซึ่งจะเห็นไดวาบริษัทเหลานี้ลวนมีชื่อเสียงในแวดวงอุตสาหกรรมซอฟตแวรและคอมพิวเตอรทั้งสิ้น1.2 ความหมายของคํ าวา “โมเดล”กอนอื่นมารูจักกับคํ าวา “ปญหา” กอน ในโครงการทํ าซอฟตแวรหนึ่งๆ นั้น แตละขั้นตอนของการดํ าเนินงานไมวาจะเปนการวิเคราะห ออกแบบ หรือพัฒนา ก็คือปญหาที่เราตองดํ าเนินการแกไข ดังนั้นเมื่อกลาวถึงคํ าวา “ปญหา” ความ


186หมายก็คือ สิ่งที่เราตองดํ าเนินการแกไขจนกระทั่งโครงการทํ าซอฟตแวรเสร็จสิ้นการดํ าเนินงานคํ าวา “โมเดล” ในวลี Modeling Language มีความหมายดังนี้โมเดล คือ ความพยายามในการที่จะอธิบายปญหาของซอฟตแวรที่จะดํ าเนินการพัฒนาขึ้นมา ตัวโมเดลจะแสดงใหเห็นถึงออบเจ็คตตางๆ ที่เกี่ยวของ และความสัมพันธระหวางออบเจ็คตเหลานั้น นอกจากนั้นโมเดลยังแสดงใหเห็นถึงวิธีการที่จะแกไขปญหา เราอาจจะใชไดอะแกรม เนื้อความ (Text) หรือรูปแบบอื่นๆ ซึ่งเปนที่ยอมรับกันระหวางผูพัฒนาและผูใชระบบในการนํ าเสนอโมเดลๆ หนึ่ง UML จะใชทั้งไดอะแกรมและเนื้อความเพื่อทํ าการนํ าเสนอโมเดลของมันดังนั้นเมื่อกลาวถึง Modeling Language ความหมายของมันก็คือ ภาษาที่เราเอาไวอธิบายโมเดลนั่นเอง Modeling Language ทั้งหลายมักจะใชไดอะแกรมหรือเนื้อความในการอธิบายถึง ออบเจ็คตและความสัมพันธระหวางออบเจ็คตเหลานั้นUML เปน Modeling Language ภาษาหนึ่งซึ่งสามารถใชในการแกไขปญหาในการดํ าเนินงานโครงการซอฟตแวร ในการแกไขปญหาหนึ่งๆUML จะใชโมเดลที่มีรูปแบบแตกตางกันจํ านวนหนึ่งโดยแตละโมเดลจะมีมุมมอง (View) ของปญหาในแงที่แตกตางกันออกไป แตเมื่อเอาโมเดลเหลานั้นมาประกอบกันเขา เราก็จะสามารถดํ าเนินการวิเคราะห ออกแบบ และพัฒนาซอฟตแวรไดอยางมีประสิทธิภาพ โมเดลที่ UMLใชจะมีลักษณะตอเนื่องกันไป กลาวคือ โมเดลหนึ่งจะอาศัยโมเดลที่สรางขึ้นมากอนหนานี้เพื่อทํ าการสรางโมเดลตัวตอไป2. ทํ าไมตองใช UMLเนื่องดวยซอฟตแวรในปจจุบันมีทั้งขนาดและความซับซอนที่มากยิ่งขึ้นและยิ่งขึ้นตามลํ าดับการดํ าเนินงานโครงการซอฟตแวรซึ่งเปนงานที่ละเอียดออนและสลับซับซอนจึงจํ าตองมีเครื่องมือที่ดีอันหนึ่งเพื่อที่จะสามารถจัดการกับขนาดและความซับซอนของซอฟตแวรเหลานั้นไดวิธีการที่โปรแกรมเมอรมักจะใชกันอยูเสมอคือการกระโดดลงไปทํ าการพัฒนาโปรแกรม(Coding) เลย กลาวคือ “คิดไปดวยและทํ าการพัฒนาโปรแกรมไปดวย” โดยปราศจากกระบวนการที่เปนระบบระเบียบและผสานกลมกลืน นับตั้งแตการวิเคราะห ออกแบบแลวจึงมาทํ าการพัฒนาโปรแกรมนั่นเอง สิ่งนี้สามารถเปรียบเทียบไดกับการขึ้นสังเวียนชกมวยเลยโดยปราศจากการเรียนรูเรื่องมวยอยางถูกตองและเหมาะสมกอนนอกจากเวลาที่ตองเสียไปในการพัฒนาซอฟตแวรที่มากกวาปกติแลว ซอฟตแวรที่ไดรับยังอาจเต็มไปดวยบัก (Software Bugs) ซึ่งยากตอการแกไขอีกทั้งเมื่อคํ านึงถึงการนํ าซอฟตแวรเหลานั้นมาใชงานซํ้ า (Code Reuse) ในวันขางหนา หรือการจัดการกับซอฟตแวรเหลานั้นเมื่อจํ าเปนตองมีเวอรชันถัดๆ ไป (Software ConfigurationManagement) การดํ าเนินการจะกระทํ าไดยากมากUML เปนเครื่องมือที่ดีอันหนึ่งซึ่งจะทํ าใหผูประกอบการซอฟตแวรสามารถดํ าเนินการทุกขั้นทุกตอนอยางสมเหตุสมผลอยางเปนระบบระเบียบและมีความตอเนื่องกันไปตั้งแตตนจนจบการดํ าเนินงาน3. กลไกการทํ างานเบื้องตนของ UMLจากที่ไดกลาวเอาไวในตอนตนวา UML ประกอบดวยโมเดลจํ านวนหนึ่งที่นํ าเอามาใชรวมกันเพื่อการดํ าเนินงานโครงการซอฟตแวร โมเดลดังกลาวคือ [2]• Use Case Diagram• Sequence Diagram• Class Diagram• Activity Diagram• Collaboration Diagram• Component Diagram• Deployment Diagram


• Object Diagram• Statechart Diagramจากโมเดลตางๆ ของ UML ที่แสดงใหดูขางบน ผูเขียนเห็นวาโมเดล 3 โมเดลแรก คือ Use CaseDiagram , Sequence Diagram และ ClassDiagram เปนโมเดลพื้นฐานที่ใชในระบบงานทั่วไป พอเพียงสํ าหรับผูอานที่จะทํ าความเขาใจเบื้องตนเกี่ยวกับกลไกการทํ างานของ UML สวนโมเดลอื่นเปนสวนเพิ่มเติมที่ผูใชสามารถเลือกมาใชเพื่ออธิบายโมเดลที่ใชถายถอดแนวความคิดของผูพัฒนาหรือผูวิเคราะหระบบ3.1 Use Case DiagramUse Case แปลตรงตัวมีความหมายวา กรณีของการใชงานที่เกิดจากมุมมองของผูใชระบบ ตัวอยางงายๆ ของ Use Case ก็คือCreate Order (ทํ าการลงใบสั่งซื้อสินคา)Modify Order (ทํ าการเปลี่ยนแปลงหรือแกไขใบสั่งซื้อสินคา)Delete Order (ทํ าการลบใบสั่งซื้อสินคา)หรืออาจจะมองไดวากรณีการใชงานดังกลาว ก็คือการอธิบายฟงกชันการทํ างานตางๆของระบบนั่นเอง แตละกรณีขางบนถือเปนหนึ่งกรณีของการใชงาน หรือเรียกทับศัพทวาหนึ่ง Use Case ตอจากนี้ไปผูเขียนจะใชคํ าวา Use Case ทับศัพทไปเลยโดยปกติแลวเราสามารถสรางแตละ Use Caseขึ้นมาโดยอาศัยการสัมภาษณจากกลุมผูใชระบบกรณีที่เราไมรูวาใครคือกลุมคนเปาหมายที่เราควรจะไปทํ าการสัมภาษณสามารถหาขอมูลเหลานี้ไดจากฝายบริหาร ซึ่งจะชี้ใหเรารูวาแผนกไหน กองไหน และใครที่เราควรจะไปติดตอเพื่อทํ าการสัมภาษณ มองกันอยางงายๆ กลุมคนเหลานั้นที่เราจะไปทํ าการสัมภาษณแตละคน ก็คือ Actorหรือผูใชระบบนั่นเองActor ในความหมายของ UML ก็คือ ผูที่ติดตอกับระบบโดยอยูภายนอกระบบ Actor อาจจะขอใหระบบทํ าอะไรใหสักอยางหนึ่ง หรือในทางกลับกันระบบอาจจะขอให Actor นั้นทํ าอะไรใหสักอยาง187หนึ่ง [3] ดังนั้นจริงๆ แลว Actor ยังหมายความรวมถึงสิ่งอื่นๆ ที่อยูนอกระบบซึ่งสามารถทํ าการติดตอกับระบบได อาทิเชน ระบบสินคาคงคลังระบบบัญชี ระบบพัสดุ เปนตนมาดูกันที่ตัวอยางของ Use Case เพื่อทํ าความเขาใจหรือมองเห็นภาพไดงายขึ้น ตัวอยางในรูปที่1 คือ ตัวอยางของ Use Case เพื่อทํ าการลงขอมูลการสั่งซื้อสินคาเขาไปในระบบ โดยแสดงเปนรูปแบบ (Template) อยางงายๆ รูปแบบหนึ่ง รูปแบบอยางงายนี้สามารถใชในการนิยาม UseCase ทั่วๆ ไป รูปแบบดังกลาวมีองคประกอบดังนี้• ชื่อของ Use Case• ภาพรวมของการทํ างาน (Overview)• Actor หลัก (Primary Actor)• Actor รอง (Secondary Actor)• จุดเริ่มตน (Starting Point)• จุดสิ้นสุด (End point)• การทํ างานของ Use Case(Flow of Events)• การทํ างานของ Use Case เมื่อมีปญหาเกิดขึ้น (Alternative Flow of Events)• ผลของการทํ างานของ Use Case(Measurable Result)แตละองคประกอบมีความหมายดังนี้• ชื่อของ Use Case : เปนการกํ าหนดชื่อของUse Case ตัวนี้ ชื่อที่ใชควรสั้นและกระชับแตสื่อความหมายที่ดีของ Use Case ตัวนี้• ภาพรวมของการทํ างาน (Overview) : อธิบายภาพการทํ างานของ Use Case ตัวนี้โดยรวมวาทํ าอะไร สวนนี้ควรมีความยาวไมเกิน 5บรรทัด• Actor หลัก (Primary Actor) : ใครคือผูใชของ Use Case ตัวนี้ จากตัวอยาง UseCase : Create Order ผู ใชคือ ตัวแทนฝายขายสินคา


188รูปที่ 1 : ตัวอยางของ Use Case เพื่อทํ าการลงขอมูลการสั่งซื้อสินคาเขาไปในระบบUse Case : Create Orderภาพรวมของการทํ างาน (Overview)จุดประสงคหลักของ Use Case นี้คือ เพื่อทํ าการลงขอมูลในใบสั่งซื้อสินคาจากลูกคาActor หลัก (Primary Actor)ตัวแทนฝายขายสินคาActor รอง (Secondary Actor)ไมมีจุดเริ่มตน (Starting Point)Use Case ตัวนี้เริ่มตนเมื่อ Actor ตัวแทนฝายขายสินคาขอใหระบบทํ าการลงขอมูลการสั่งซื้อสินคาจุดสิ้นสุด (End point)คํ าขอเพื่อทํ าการลงขอมูลการสั่งซื้อสินคาเสร็จสิ้นสมบูรณหรือไมก็ถูกยกเลิกการทํ างานของ Use Case (Flow of Events)จาก User Interface บนจอเพื่อทํ าการลงขอมูลการสั่งซื้อ Actor จะตองทํ าการใสขอมูลเกี่ยวกับการสั่งซื้อ เปนตนวา วันที่ลูกคาตองการใหสินคาสงมอบถึงมือ (Required Date)ปริมาณที่ตองการสั่งซื้อ (Quantity) ตองการใหสงมอบสินคาโดยบริษัทรับสงสินคาไหน(ShipVia) ตองการใหสงมอบสินคาที่ไหน (ShipAddress) หลังจากนั้นแลว Actor สามารถเลือกที่จะทํ าการบันทึกขอมูลลงไปไวในฐานขอมูล หรือยกเลิกการทํ างานทั้งหมด ถา Actor เลือกทํ าการบันทึก ใบสั่งซื้อสินคาใบใหมก็จะถูกสรางขึ้นมาในฐานขอมูลการทํ างานของ Use Case เมื่อมีปญหาเกิดขึ้น (Alternative Flow of Events)ถาไมมีสินคาที่ตองการอยูในคลังสินคา ระบบจะตองแจงให Actor ทราบพรอมกันนั้นก็ตองยกเลิกการทํ างานที่เหลือของ Use Case นี้ผลของการทํ างานของ Use Case (Measurable Result)จะมีใบสั่งซื้อสินคาใหม 1 ใบ ถูกสรางขึ้นมาในระบบหมายเหตุ : ในแตละสวนของ Use Case ขางบน เราไดใชภาษาอังกฤษประกอบการอธิบาย เพื่อใหรูที่มาวาในภาษาอังกฤษเขาใช Term ตางๆ กันอยางไร แตเมื่อมีการนํ า Use Case ไปใชงานจริง ไมจํ าเปนตองมีภาษาอังกฤษอีกตอไป


• Actor รอง (Secondary Actor) : ใครคือผูใชอื่นๆ นอกเหนือจาก Actor หลัก ที่เปนผูใชUse Case ตัวนี้ ตัวอยาง Use Case :Create Order ขางบนไมมีผูใชอื่นๆ ที่จะใชUse Case ตัวนี้รวมกับ Actor หลัก ในบางระบบงานอาจจะเปนไปไดวามีผูใชอื่น เชน ผูจัดการฝายขายซึ่งสามารถใช Use Case ตัวนี้รวมกับตัวแทนฝายขายสินคา• จุดเริ่มตน (Starting Point) : เปนการอธิบายเงื่อนไขหรือขอกํ าหนดตางๆ ณ จุดเริ่มตนของ Use Case โดยเงื่อนไขเหลานี้ โดยปกติแลวจะตอง “มี” หรือ “เปน” อยางนั้นกอนการทํ างานของ Use Case นี้ ในตัวอยางของUse Case : Create Order ที่แสดงใหดูเงื่อนไขคือ Use Case จะเริ่มตนเมื่อ Actorขอใหระบบทํ าการลงขอมูลการสั่งซื้อสินคาในใบสั่งซื้อสินคา• จุดสิ้นสุด (End point) : คลายกับจุดเริ่มตนเปนการอธิบายเงื่อนไขหรือขอกํ าหนดตางๆณ จุดสิ้นสุดการทํ างานของ Use Case ตัวนี้ในตัวอยางของ Use Case : Create Orderที่แสดงใหดู เงื่อนไขที่จุดสิ้นสุดคือ คํ าขอเพื่อการลงบันทึกขอมูลการสั่งซื้อสินคาจะตองเสร็จสิ้นสมบูรณหรือไมก็ถูกยกเลิก กลาวคือสิ่งใดสิ่งหนึ่งเทานั้นจะเกิดขึ้น แตไมใชทั้งสองเกิดขึ้นพรอมๆ กัน• การทํ างานของ Use Case (Flow of Events): อธิบายขั้นตอนของการทํ างานของ UseCase นี้ ตัวอยางของ Use Case ขางบนแสดงใหเห็นขั้นตอนการทํ างานของ UseCase นี้เพื่อทํ าการลงบันทึกขอมูลการสั่งซื้อสินคานับตั้งแตเริ่มตนจนกระทั่งสิ้นสุด ขั้นตอนการทํ างานเหลานี้เรียกวา ขั้นตอนการทํ างานปกติของ Use Case• การทํ างานของ Use Case เมื่อมีปญหาเกิดขึ้น (Alternative Flow of Events) : การทํ างานของ Use Case ในกรณีเมื่อมีปญหาใดๆ ก็ตามเกิดขึ้น และทํ าใหการทํ างานตามปกติของ Use Case ไมสามารถดํ าเนินตอไป189ได จะทํ าใหมีการสงตอการทํ างานของ UseCase จากขั้นตอนการทํ างานปกติ (ในสวนของการทํ างานของ Use Case) มาที่สวนนี้ของ Use Case ในตัวอยางของ Use Case :Create Order ที่แสดงใหดู เมื่อระบบพบวาสินคาตัวที่ลูกคาตองการไมมีอยูในคลังสินคานั่นหมายถึงระบบมีปญหาเกิดขึ้น ระบบก็จะทํ าการแจงให Actor ทราบและยกเลิกการทํ างานที่เหลือของ Use Case นี้ทันที• ผลของการทํ างานของ Use Case(Measurable Result) : ผลการทํ างานของUse Case แสดงใหเห็นวาเมื่อเสร็จสิ้นการทํ างานของ Use Case นี้แลว จะมีอะไรเกิดขึ้นเปนผลพวง ในตัวอยางของ Use Case :Create Order ที่แสดงใหดู จะมีใบสั่งซื้อสินคาใบใหมเพิ่มขึ้น 1 ใบในฐานขอมูลของเรารูปแบบของ Use Case ที่แสดงใหดูในรูปที่ 1เปนเพียงรูปแบบงายๆ รูปแบบหนึ่งเทานั้น สวนการใชงานจริงผูใชอาจเพิ่มเติมสวนตางๆ ลงไปเองไดตามความเหมาะสม ทั้งนี้ขึ้นอยูกับการตกลงกันระหวางกลุมผูพัฒนาระบบและผูใชระบบนั้นๆ3.2 Sequence DiagramSequence Diagram คือ ไดอะแกรมที่แสดงลํ าดับขั้นตอน (Sequence) การทํ างานภายในของ UseCase ตัวหนึ่ง โดยตัว Use Case เองแลวเราจะไมสามารถมองเห็นลํ าดับขั้นตอนการทํ างานภายในของ Use Case ตัวนั้นได ตัว SequenceDiagram ตางหากที่ทํ าใหเราสามารถมองเห็นลํ าดับขั้นตอนการทํ างานภายในของ Use Caseตัวนั้นไดนอกจากนี้ Sequence Diagram ยังแสดงใหเห็นถึงการติดตอกันระหวาง• ออบเจ็คตตางๆ ของ Use Case นั้น และ• ออบเจ็คต และ Actor ของ Use Case นั้น


190การติดตอกันดังกลาวจะทํ าใหมีขอความ(Message) วิ่งไปมาในไดอะแกรมนั้นที่กลาววา “ออบเจ็คตตางๆ ของ Use Case” สิ่งนี้หมายความวาใน Use Case ตัวหนึ่งๆ จะมีออบเจ็คตที่เกี่ยวของกับ Use Case นั้นมากกวา 1ประเภท อาทิเชน Use Case : Create Orderอยางนอยจะประกอบไปดวยออบเจ็คต 2 ประเภทกลาวคือ Product และ OrderProduct คือ สินคาที่ลูกคาตองการซื้อ สวน Orderคือ ใบสั่งซื้อสินคาใบหนึ่งของลูกคา ดังนั้นจึงสามารถกลาวไดวาออบเจ็คต Product และ Orderก็คือ “ออบเจ็คตของ Use Case นี้”รูปที่ 2 แสดงใหเห็นถึง Sequence Diagram ของCreate Order ซึ่งจะเห็นไดวามี ออบเจ็คตที่เกี่ยวของ 4 ประเภท กลาวคือ Interface, Product,รูปที่ 2 Sequence Diagram ของ Create OrderOrder และ Database (สังเกตุกลองสี่เหลี่ยมขางบนไดอะแกรม) สวนรูปตัวคนทางซายมือก็คือActor ตัวแทนฝายขาย (ซึ่งก็คือ Actor ของ UseCase: Create Order นั่นเอง)แกนในแนวตั้ง 5 แกนคือ แกนเวลาของ ไดอะ-แกรม ลูกศรในไดอะแกรมคือการสงขอความจากออบเจ็คตหนึ่งไปหาออบเจ็คตอีกตัวหนึ่ง เปนตนวาขอความ Get Product List ซึ่งสงจากออบเจ็คตInterface ไปยังออบเจ็คต Product ขอความที่อยูดานบนของไดอะแกรมจะเปนขอความที่เกิดกอนขอความที่อยูดานลางเรียงตามลํ าดับเวลา เปนตนวา ขอความ Get Product List จะเกิดขึ้นกอนขอความ Return Product List ดังนั้นจึงสามารถกลาวไดวา Sequence Diagram เปนไดอะแกรมที่เนนเรื่องการเกิดขึ้นเรียงตามลํ าดับเวลา(Temporal): Interface : Product : Order : Database: ตัวแทนฝายขายRequest Product ListingDisplay Product ListGet Product ListReturn Product ListทอนบนSelect ProductCreate OrderIDProduct SelectedRequest to Create OrderIDCreate OKAdd Product to OrderDisplay OrderAdd OKRequest to Display OrderSave OrderOrder to SaveOrder to SaveทอนลางCancel OrderSave OKSave OK


ของขอความตางๆ ภายใน ไดอะแกรมกอนอธิบายตัว Sequence Diagram สํ าหรับCreate Order ขออธิบายขอจํ ากัดของ CreateOrder ที่เราใชเปนตัวเดินเรื่องทั้งหมดกอน เพื่อจุดประสงคในการแสดงใหดูเปนตัวอยาง การลงบันทึกในใบสั่งซื้อนี้จึงเปนการลงบันทึกแบบงายๆกลาวคือ สามารถมีสินคาในใบสั่งซื้อหนึ่งใบไดเพียงประเภทเดียว (ในทางปฏิบัติอาจจะมีหลายประเภทสินคาในหนึ่งใบสั่งซื้อได) ดังนั้นตัวอยางSequence Diagram สํ าหรับ Create Order จะแสดงใหเห็นถึงลํ าดับของเหตุการณการลงบันทึกแบบงายๆ ดังกลาวSequence Diagram สํ าหรับ Create Order มีการทํ างานเรียงตามลํ าดับเวลาดังนี้1. Request Product Listing : จาก UserInterface ที่แสดงบนหนาจอ Actor จะทํ าการขอใหระบบแสดงรายการของสินคาทั้งหมดออกมาทางหนาจอ2. Get Product List : ออบเจ็คต User Interfaceหรือเรียกงายๆ วา Interface ก็จะทํ าการสงตอคํ าขอนั้นไปให “เจาของเรื่อง” ซึ่งก็คือProduct3. Return Product List : “เจาของเรื่อง” ออบเจ็คต Product ก็จะทํ าการสงรายการสินคาทั้งหมดที่มีอยูกลับคืนมาให Interface4. Display Product List : ออบเจ็คต Interfaceเมื่อไดรับรายการสินคาแลวก็จะทํ าการแสดงรายการของสินคาเหลานั้นออกมาทางหนาจอให Actor ดู ซึ่งจะเห็นไดวาเปนการสงขอความเขาหาตัวเอง (Reflexive Message)5. Select Product : Actor จะทํ าการคลิกที่สินคาตัวหนึ่ง (จากรายการสินคาทั้งหมดที่แสดงบนหนาจอ) ซึ่งลูกคาตองการซื้อ6. Product Selected : Interface ก็จะทํ าการสงตอขอมูลสินคาที่ Actor ทํ าการเลือกแลวนั้นไปยัง Product7. Request to Create OrderID : เมื่อ Productไดรับขอมูลสินคานั้นแลว ก็จะสงคํ าขอไปยัง191Order เพื่อขอใหสราง ID ใหมใหตัวหนึ่งสํ าหรับใบสั่งซื้อสินคาใบนี้8. Create OrderID : เจาของเรื่องคือ Order ก็จะทํ าการสราง ID ใหมขึ้นมา ID หนึ่งสํ าหรับใบสั่งซื้อนี้ ซึ่งจะเห็นไดวาเปนการสงขอความเขาหาตัวเอง (Reflexive Message) เชนเดียวกับDisplay Product List9. Create OK : หลังจากนั้นออบเจ็คต Order ก็สงขอความไปบอก Product วาคํ าขอเพื่อสราง ID นั้นไดทํ าสํ าเร็จแลว10. Add Product to Order : หลังจากนั้นProduct จึงทํ าการสงขอมูลของสินคา (ที่ลูกคาตองการซื้อ) ไปให Order เพื่อทํ าการลงบันทึกในใบสั่งซื้อสินคานั้น11. Add OK : เมื่อเสร็จสิ้นการบันทึกแลว Orderจึงบอกให Product รูวาไดดํ าเนินการเสร็จแลว12. Request to Display Order : พรอมกันนั้นOrder ก็สงคํ าขอไปยัง Interface เพื่อขอใหInterface ทํ าการแสดงขอมูลรายละเอียดทั้งหมดของใบสั่งซื้อนี้ออกมาทางหนาจอเพื่อใหActor ดู13. Display Order : Interface ทํ าการแสดงขอมูลรายละเอียดของใบสั่งซื้อนี้ออกทางหนาจอ(ตามคํ าขอจาก Order)14. Save Order : ตอจากนั้น โดย InterfaceActor ก็จะทํ าการคลิกปุม Save เพื่อทํ าการSave ขอมูลของใบสั่งซื้อสินคานั้น15. Cancel Order : ใหสังเกตในไดอะแกรมที่ขอความ Save Order ที่สงจากตัวแทนฝายขายจะมีขอความอีกอันหนึ่งคือ ขอความ CancelOrder แยกออกมาจากจุดรวมเดียวกัน จุดที่มีการแยกออกดังกลาวเปนสัญญลักษณของการตัดสินใจที่จะเลือกทํ าอันใดอันหนึ่งเทานั้นความหมายของจุดแยกนี้ก็คือ ถา Actor ตัดสินใจทํ าการ Save ขั้นตอนการทํ างานที่เหลือเรียงตามลํ าดับเวลาจะประกอบไปดวยขอความ


192Order to Save (จาก Interface):Interface สงขอมูลของใบสั่งซื้อนี้ไปใหเจาของเรื่อง OrderOrder to Save (จาก Order): เจาของเรื่อง Order สงตอขอมูลนั้นให Database เพื่อจะไดทํ าการบันทึกขอมูลนั้นตอไปSave OK (จาก Database): Databaseแจงให Order รูวาไดทํ าการบันทึกเรียบรอยแลวSave OK (จาก Order): Order แจงInterface วาการบันทึกขอมูลไดดํ าเนินการเสร็จสิ้นแลวถาหากตัดสินใจยกเลิก (อาจเปนเพราะราคาสินคาที่ลูกคาคิดวาแพงเกินไป) คือ ไม Save การทํ างานจะสิ้นสุดทันที โปรดสังเกตุวาการตัดสินใจเลือกทํ าการ Save หรือ Cancel เปน Statementหนึ่งที่ปรากฏในสวนของการทํ างานของ UseCase ดวย (ใหดูในสวนของการทํ างานของ UseCase ของ Use Case: Create Order ดวย)3.2.1 ความสอดคลองกันระหวาง Use Caseและ Sequence DiagramSequence Diagram ในรูปที่ 2 จริงๆ แลวถูกสรางขึ้นมาจาก Use Case: Create Order (เนื่องจากบทความนี้เปนบทความที่แสดงใหเห็นภาพโดยรวมของ UML จึงยังไมสอนวิธีการสรางSequence Diagram จาก Use Case) ในเบื้องตนนี้เราจะชี้ใหเห็นถึงความสอดคลองกันระหวางUse Case และ Sequence Diagram สํ าหรับCreate Orderทอนบนของ Sequence Diagram (หาคํ าวา ”ทอนบน” ในไดอะแกรม) สํ าหรับ Create Orderเทียบเทากับ Statement ดังนี้ (ใหดูในสวนการทํ างานของ Use Case ของ Use Case: CreateOrder ในรูปที่ 1 ประกอบดวย)“จาก User Interface บนจอเพื่อทํ าการบันทึกขอมูลการสั่งซื้อ Actor จะตองทํ าการใสขอมูลเกี่ยวกับการสั่งซื้อ เปนตนวา วันที่ลูกคาตองการใหสินคาสงมอบถึงมือ (RequiredDate) ปริมาณที่ตองการสั่งซื้อ (Quantity) ตองการใหสงมอบสินคาโดยบริษัทรับสงสินคาไหน (ShipVia) ตองการใหสงมอบสินคาที่ไหน (ShipAddress)”ทอนลางของ Sequence Diagram (หาคํ าวา ”ทอนลาง” ในไดอะแกรม) เทียบเทากับStatement สวนที่เหลือของ Use Case นี้ กลาวคือ “หลังจากนั้น Actor สามารถเลือกที่จะทํ าการบันทึกขอมูลลงไปไวในฐานขอมูล หรือยกเลิกการทํ างานทั้งหมด ถา Actor เลือกทํ าการบันทึกขอมูล ใบสั่งซื้อสินคาใบใหมก็จะถูกสรางขึ้นมาในฐานขอมูล”ดังนั้น ณ จุดนี้จึงขอสรุปเกี่ยวกับ SequenceDiagram ไวดังนี้Sequence Diagram ถูกสรางขึ้นมาจากUse Case ตัว Use Case มิไดบอกรายละเอียดของการทํ างานภายในวาเปนอยางไร SequenceDiagram ตางหากเปนตัวบอกวามีรายละเอียดการทํ างานภายในอยางไร และรายละเอียดการทํ างานภายในเหลานั้นก็คือ ขอความที่วิ่งไปมาในไดอะแกรมนั้นสวนคํ าถามถัดมาที่ผูอานอาจอยากจะถามคือ ขอความที่วิ่งไปมาเหลานั้นมีประโยชนอะไร เราจะไขคํ าตอบสํ าหรับคํ าถามนี้ในหัวขอ Class Diagramขางลาง3.3 Class Diagramกอนอื่นขอนิยามคํ าวา “Class” กอน “Class” คือเซ็ตของออบเจ็คตที่มีคุณสมบัติ (Properties) และพฤติกรรม (Methods) เชนเดียวกัน ตัวอยางเชนClass ของหนังสือมีลักษณะดังแสดงในรูปที่ 3และเราอาจมีออบเจ็คตตางๆ ดังนี้อยูใน ClassBook ดังตารางที่ 1 ขางลางในตารางจะเห็นไดวาทั้ง 3 ออบเจ็คตที่แสดงในตารางก็คือ เซ็ทของออบเจ็คตที่มีคุณสมบัติBookAuthor, BookCategory, ISBN และPublishedYear เหมือนกัน แตเนื้อหาสาระ(Content) ของคุณสมบัติเหลานั้นจะไมเหมือนกัน


เชน หนังสือที่มี ISBN 1111 ผูแตง คือ รัชนี สวนหนังสือที่มี ISBN 1234 ผูแตง คือ ชาลีรูปที่ 3 ตัวอยาง Class BookBookBookAuthorBookCategoryISBNPublishedYearAddBook()UpdateBook()193ในการดํ าเนินการพัฒนาซอฟตแวรตัวหนึ่งๆโปรแกรมเมอรจะทํ าการพัฒนาซอฟตแวรตามClass ตางๆ เหลานั้นทั้งหมดที่ไดกํ าหนดขึ้นมาClass Diagram ใน UML มีรูปแบบดังรูปที่ 4 คือรูปที่ 4 รูปแบบของ Class DiagramClass nameClass propertiesClass Methodตารางที่ 1 ตัวอยางของ Class BookBook-AuthorBook-CategoryISBN Published-Yearรัชนี Algorithm 1111 1998ชาลี OS 1234 1995นพพร DBMS 1345 1996นอกจากการมีคุณสมบัติที่เหมือนกันแลว ออบเจ็คตในคลาสเดียวกันยังมีพฤติกรรมที่เหมือนกันอีกดวย ตัวอยางเชน ในการเปลี่ยนแปลงรายละเอียดของหนังสือเลมหนึ่งๆ ออบเจ็คตทั้งหลายที่อยูใน Class นี้สามารถใชพฤติกรรมUpdateBook() เพื่อทํ าการเปลี่ยนแปลงรายละเอียดของหนังสือเลมนั้นๆจากความหมายของ Class ที่ไดนิยามไวขางบนความหมายของ Class Diagram ก็คือภาพที่ประกอบไปดวย Class ตางๆ ที่มาประกอบหรือรวมตัวกันกลายเปนระบบหรือซอฟตแวรตัวหนึ่งเปนตน ยกตัวอยางเชน Class : Interface,Product, Order, Database เปนตนโดย Class ทั้งสี่สวนนี้มีที่มาจาก SequenceDiagram สํ าหรับ Create Order (ใหสังเกตุวากลองสี่เหลี่ยมขางบน Diagram คือ ออบเจ็คตของคลาสทั้งสี่นั่นเอง)ซึ่งจะเห็นไดวาแตละสวนของไดอะแกรมนี้ (ซึ่งมีอยู 3 สวน) จะสอดคลองกับ Class Book ที่แสดงในรูปที่ 3ในทางปฏิบัติระบบที่พัฒนาจะมี Class ตางๆที่เกี่ยวของมากกวา 1 Class เชน ระบบการสั่งซื้อสินคา อาจจะมี Class customer , Class Orderซึ่ง Class ทั้งสองอาจมีความสัมพันธกันในลักษณะใดลักษณะหนึ่ง แตในบทความฉบับนี้ตองการเนนใหเห็นถึงสัญญลักษณของ ClassDiagram และองคประกอบของ Class จึงยังไมกลาวถึงความสัมพันธของ Class เหลานั้นเราจะใชตัวอยางการทํ าการบันทึกขอมูลเกี่ยวกับการสั่งซื้อสินคา Create Order ในสองหัวขอที่แลวกลาวคือ Use Case และ SequenceDiagram เพื่อแสดงใหผูอานเห็นถึงการไดมาซึ่งClass Diagram สํ าหรับ Class Order (สวนClass อื่นๆ ก็จะอาศัยวิธีการเดียวกัน เพื่อจะใหไดมาซึ่ง Class Diagram ของมัน)เมื่อตอนเริ่มตนสิ่งแรกที่เรามีสํ าหรับ Class Orderคือ Class Order ซึ่งวางเปลาดังแสดงในรูปที่ 5


194รูปที่ 5 ตัวอยาง Class Order ที่วางเปลาOrderวางเปลาวางเปลา3.3.1 Class Propertiesในสวนของ Class Properties คุณสมบัติที่เกี่ยวของกับ Class Order มีดังนี้รูปที่ 6 ตัวอยาง Class OrderOrderOrderIDOrderDateRequiredDateShipViaShipDateShipAddressUnitPriceQuantityวางเปลาคุณสมบัติดังกลาวไดมาจาก Use Case : CreateOrder โดยสังเกตุจากตัวอักษรเขมใน “สวนของการทํ างานของ Use Case” ความจริงอยางหนึ่งที่เรารูก็คือ ในขณะที่เราทํ าการสัมภาษณ Actorของ Use Case นี้ Actor จะเลาใหเราฟงวา“เมื่อมีลูกคาโทรเขาสั่งของ ลูกคาจะตองการบอกเราในรายละเอียด เชน วันที่ลูกคาตองการใหสินคาสงมอบถึงมือ (RequiredDate)ตองการสินคานั้นกี่ชิ้น (Quantity) ตองการใหสงมอบสินคาอยางไร (ShipVia) ตองการใหสงมอบสินคาที่ไหน (ShipAddress) เปนตน”Actor โดยปกติจะตองมีรายละเอียด เชน ราคาของสินคาตอชิ้น (UnitPrice) วันที่ที่สินคาถูกสงออกไปโดยบริษัทที่รับสงของ (ShipDate) สวนคุณสมบัติของ OrderID ซอฟตแวรที่จะดํ าเนินการสรางจะทํ าการคํ านวณใหเราโดยอัตโนมัติ ดังนั้นโดยสรุปแหลงที่มาของคุณสมบัติของ Classหนึ่งๆ จะมาจาก Use Case (อาจจะมากกวา 1Use Case เชน นอกจากมาจาก Create Orderแลวยังสามารถมาจาก Modify Order หรือDelete Order ไดดวย) และขอมูลจากการสัมภาษณกับ Actor ของ Use Case นั้น3.3.2 Class Methodsสิ่งสุดทายที่เราตองการคือ Class Methods ซึ่งจะไดมาจาก Sequence Diagram สิ่งที่เราควรทราบเบื้องตนก็คือ ขอความแตละขอความในSequence Diagram สามารถเทียบเทากับMethod 1 Method มาดูกันที่ตัวอยางการกํ าหนดClass Methods ของ Class Order เพื่อจะไดเห็นภาพที่แทจริงกันเลยหลักการหา Method มีดังนี้1. จาก Sequence Diagram สํ าหรับCreate Order พิจารณาเฉพาะขอความที่วิ่งเขาหรือออกจากแกนเวลาของ Order เทานั้น รูปที่ 7เปนไดอะแกรมที่ตัดออกมาจากไดอะแกรมตัวสมบูรณ (ในรูปที่ 2 ) ไดอะแกรมที่ตัดออกมานี้ประกอบดวยขอความเฉพาะที่เกี่ยวของกับ ClassOrder เทานั้น ซึ่งจะเห็นไดวามีลูกศรวิ่งเขาออกจากแกนเวลาของ Orderสิ่งหนึ่งที่ผูอานอาจจะรูสึกวานาจะเปนคือ ขอความตางๆที่วิ่งไปมาแตละขอความนาจะมีMethod ตัวหนึ่งมาทํ าหนาที่ในการสื่อสารนั้น ยกตัวเอยางเชน ขอความ Request to CreateOrderID จาก Product ไปหา Order จะมีMethod : RequestToCreateOrderID() มาทํ าหนาที่ในการสื่อสาร ซึ่งในที่นี้ก็คือ คํ าขอใหOrder ชวยสราง ID ให 1 ID สํ าหรับใบสั่งซื้อสินคานี้


Request to Display OrderOrder to SaveSave OKRequest to Create OrderIDAdd Product to OrderCreate OKAdd OKCreate OrderIDOrder to SaveSave OKรูปที่ 7 Sequence Diagram สํ าหรับ Create Order เฉพาะขอความที่เกี่ยวของกับ Class Order195: Interface : Product : Order : Database: ตัวแทนฝายขายณ จุดนี้คํ าถามหนึ่งที่ผูอานอยากจะถามก็คือ ขอความ Request to Create Order ID ควรจะเปนของ Class ไหน ระหวาง Class Product และOrder คํ าตอบของคํ าถามนี้จึงเกิดเปนหลักการขอที่ 22. หลักการในขอนี้เปนหลักการอันหนึ่งที่สามารถใชไดและเปนที่ยอมรับโดยทั่วไป”ถาขอความที่พิจารณามีเนื้อหาสาระหนัก(weight) ไปทาง Class ไหนมากกวา (ระหวาง 2Class) ขอความนั้นก็จะกลายเปน Method หนึ่งMethod ของ Class นั้น”โดยใชหลักการนี้ เราสามารถทํ าการกํ าหนดMethod ใหกับ Class Order ไดดังตารางที่ 2เราสรุปไดวา Methods ของ Class Orderประกอบไปดวย• Create OrderID• Create OK• Add OK• Request to Display Order• Order to Sace (จาก interface)• Save Order (จาก Order)


196ตารางที่ 2 ตารางแสดงขอความที่เกี่ยวของกับคลาสหนึ่งๆMessageClassInterface Product Order DatabaseRequest to Create Order IDCreate Order IDCreate OKAdd Product to OrderAdd OKRequest to Display OrderOrder to Save (จาก Interface) Order to Save (จาก Order)Save OK (จาก Database)Save OK (จาก Order)(ใหสังเกตุเครื่องหมาย ในคอลัมน Order ในตารางที่ 2)มาดูกันที่ Method อื่นๆ ซึ่งไมอยูใน Class Orderกันกอน สาเหตุของการที่ Methodอื่นๆ (ใหดูในตารางที่ 2 ประกอบตรงเครื่องหมาย ที่ไมอยูในคอลัมน Order) กลาวคือ• RequestToCreateOrderID()• AddProductToOrder()• OrderToSave()• SaveOK() (จาก Database)Methods ของ Class Order สามารถอธิบายไดดังนี้• RequestToCreateOrderID() : ควรจะเปนของ Product เพราะ Product เปนคนขอใหOrder ทํ าการสราง OrderID ใหมขึ้นมาตัวหนึ่ง• AddProductToOrder() : ควรจะเปนของProduct เพราะProduct เปนคนขอให Orderทํ าการใสขอมูลของสินคาที่ลูกคาตองการซื้อลงไปในใบสั่งซื้อสินคานั้น• OrderToSave() : ควรจะเปนของ Interfaceเพราะ Interface เปนคนสงขอมูลของใบสั่งซื้อสินคาไปให Orderรูปที่ 8 Class Order และ MethodOrderOrderIDOrderDateRequiredDateShipViaShippedDateShipAddressUnitPriceQuantityCreateOrderID()CreateOK()AddOK()RequestToDisplayOrder()OrderToSave()SaveOK()----------------• SaveOK() (จาก Database) : ควรจะเปนของ Database เพราะ Database เปนคนแจงให Order ทราบวาใบสั่งซื้อสินคานั้นไดทํ าการ Save เรียบรอยแลว


สรุปโดยหลักการก็คือ ถา Class 1 เปนผูขอใหClass 2 ทํ าอะไรใหก็ตาม (โดยการสงขอความไปให Class 2) Class 1 จะมี นํ้ าหนักมากกวา ทั้งนี้เพราะ Class 1 เทานั้นถึงจะที่รูดีวากํ าลังใหClass 2 ทํ าอะไรใหอยู ดังนั้น Method ทั้งสี่ขางบนจึงควรไปอยูกับ Class อื่นๆ เหลานั้นที่มิใชOrderสวน Method ที่เปนของ Class Order ก็สามารถตอบไดโดยอาศัยหลักการเดียวกับหลักการในยอหนาที่แลว3.3.3 Method ของ Class Order จากSequence Diagram อื่นๆรูปที่ 9 Class Order และ MethodOrderOrderIDOrderDateRequiredDateShipViaShippedDateShipAddressUnitPriceQuantityCreateOrderID()CreateOK()AddOK()RequestToDisplayOrder()OrderToSave()SaveOK()DeleteOrder()ModifyOrder()Class Order อาจจะมี Sequence Diagram อื่นๆ(นอกจาก Create Order Sequence Diagram) ที่197เกี่ยวของกับมัน อาทิเชน Delete OrderSequence Diagram หรือ Modify OrderSequence Diagram เปนตน SequenceDiagram อื่นๆ เหลานี้ก็จะเปนที่มาของ Methodอื่นๆ (นอกเหนือจาก Mehtod ในรูปที่ 8) เปนตนวา DeleteOrder(), ModifyOrder() , และอื่นๆดังนั้น Class Diagram สํ าหรับ Order จึงสามารถรวมเอา Methods อื่นๆ เหลานั้นเขาไปดวย กลาวคือ (ใหดูที่ Method ที่เปนตัวอักษรเขม)3.3.4 Class อื่นๆ นอกจาก Class Orderสํ าหรับ Class อื่นๆ เชน Class : Interface,Product, Database เปนตน ผูอานสามารถใชวิธีการเดียวกันที่นํ าเสนอมาตั้งแตตนในหัวขอ ClassDiagram เพื่อทํ าการหาคุณสมบัติและ Methodของมัน ในที่สุดแลวเราก็จะไดไดอะแกรมของทุกClass ในระบบของเราออกมาและสามารถนํ าเอาไปทํ าการพัฒนาเปนโปรแกรมไดตอไป4. ภาพโดยรวมของกระบวนการทํ างานทั้งหมดของ UMLจากในหัวขอ 3.1, 3.2 และ 3.3 ที่ไดนํ าเสนอไปแลวในเรื่อง Use Case, Sequence Diagramและ Class Diagram เรียงตามลํ าดับหัวขอดังกลาว เราจึงสามารถสรุปภาพโดยรวมของกระบวนการทํ างานทั้งหมดของ UML ดังแสดงไวในรูปที่ 10กลาวคือ• สิ่งแรกที่เราตองทํ าคือ การหา Use Case ทั้งหมดในระบบ• ถัดมาคือ การสราง Sequence Diagram ที่สอดคลองกับ Use Case ตัวหนึ่งๆ• สิ่งสุดทายคือการสราง Class Diagram ClassDiagram จะประกอบไปดวย Class ทั้งหมดในระบบ สวน Class หนึ่ง Class ในไดอะแกรมนั้นโดยปกติจะถูกสรางขึ้นมาจากหลายUse Case และหลาย Sequence Diagramโดยที่ทั้ง Use Case และ Sequence


198Diagram ดังกลาวนั้นจะตองมีความเกี่ยวของกับ Class ตัวนั้นรูปที่ 10 กระบวนการทํ างานของ UMLUse CaseSequenceDiagramClassDiagramหนังสืออางอิง[1] VB6 UML Design and Development, JakeSturm ,Wrox Press ltd. , 1999[2] Instant UML, Pierre-Alain Muller , Wroxpress Ltd , 1997[3] Applying Use Cases , Geri Scheider ,Jason P.Winters , Asddison-Wesley,March 1999พ.ศ. 2537 และพ.ศ 2541 ตามลํ าดับ ไดเริ่มทํ างานที่ศูนยเทคโนโลยีอิเล็กทรอนิกสและคอมพิวเตอรแหงชาติในตํ าแหนงนักวิจัย เมื่อเดือนมิถุนายน พ.ศ 2541 ปจจุบันรับผิดชอบในงานดานการวางแผน วิเคราะห และออกแบบโครงสรางพื้นฐานของ NECTEC’s MISนางญาณวรรณ สินธุภิญโญ จบการศึกษาระดับปริญญาโทจากจุฬาลงกรณมหาวิ ทยาลั ย สาขาเทคโนโลยีสารสนเทศ เมื่อป พศ.2538 เริ่มทํ างานกับศูนยเทคโนโลยีอิเล็กทรอนิกสและคอมพิวเตอรแหงชาติในตํ าแหนงนักวิจัย โดยรับผิดชอบงานในดานการวิเคราะห ออกแบบและพัฒนาระบบสารสนเทศดานตางๆขององคกร ในระหวางเดือนตุลาคม พศ.2540 – พฤศจิกายน 2540 ไดรับทุนจาก the Japan International Co-operationAgency (JICA)เพื่อไปอบรมในดาน ComputerSoftware Technology ที่ประเทศสิงคโปร ปจจุบันปฏิบัติงานในงานโครงการเครือขาย NECTECNetประวัติผูเขียนดร.บรรจง หะรังษี เกิดที่จังหวัดลพบุรีเมื่อวันที่ 19กรกฎาคม พ.ศ. 2508 จบการศึกษาระดับปริญญาตรี สาขาวิทยาการคอมพิวเตอร เกียรตินิยมอันดับสอง จากมหาวิทยาลัยหอการคาไทยเมื่อ พ.ศ 2532 จบการศึกษาระดับปริญญาโท และปริญญาเอก สาขาComputer Science and Engineering จากUniversity of New South Wales, Australia เมื่อป


Standardization Activitiesand Open Source Movements in Thailand 1199Theppitak Karoonboonyanan, Thaweesak KoanantakoolNational Electronics and Computer Technology CenterNational Science and Technology Development AgencyMinistry of Science Technology and Environment, Thailand.theppitak@nectec.or.th, htk@nectec.or.thABSTRACT — Standardization plays an important role in settling interoperability problems.This paper presents a survey on activities relating to IT standardization during the recent years inThailand. Character sets, internationalization, font metrics, and studies on Tai scripts are discussed.In addition, the open source movements provide the stage for the standards to be realized and arebeneficial to the promotion of the standards, as summarized in the paper.บทคัดยอ — การกํ าหนดมาตรฐานมีบทบาทสํ าคัญตอการทํ างานเขากันไดของระบบตางๆ บทความนี้นํ าเสนอบทสํ ารวจกิจกรรมตางๆ ที่เกี่ยวของกับการกํ าหนดมาตรฐานเทคโนโลยีสารสนเทศในประเทศไทย อันประกอบดวย รหัสอักขระ การทํ าใหเปนสากล (internationalization) สัดสวนขนาดของฟอนตภาษาไทย และการศึกษาตัวอักษรตระกูลไท นอกจากนี้ ยังกลาวถึงความเคลื่อนไหวของซอฟตแวรตนรหัสเปด (open source software)ซึ่งสามารถเปนเวทีสํ าหรับการสรางซอฟตแวรที่ตรงตามมาตรฐาน และในขณะเดียวกัน ก็มีผลตอการรณรงคการใชมาตรฐานเองอีกดวย0. IntroductionStandardization of IT in Thailand wasrecognized since 1984, when there were morethan 26 sets of character codes were in use [1].Two years later, an agreed standard code forThai language was announced as a ThaiIndustrial Standard, TIS 620-2529/1986.However, at that time, only the codes werestandardized. The input/output systems forcomputer processing [2] have not yet beenunified. Operating systems and applicationshave been localized individually, based ondifferent conventions. The proprietary standardthat gains the lion’s share in the marketbecomes de facto, no matter how itsenhancement makes it deviated from industrialstandards. Interoperability problem is thereforeinevitable, especially in the age that differentsystems are connected through the Internet.Hence, standardization plays an important rolein moderating the plethora of practices.Recently, the open source paradigm has beenwidespread, and has become another model for1 Published in the Proceedings of MLIT-4 : Fourth International Symposium on Standardization ofMultilingual Information Technology, October 27-28, 1999, Yangon, Union of Myanmar. It issponsored by CICC/MITI/MCF. Contact person of CICC is Mr. Takayuki Sato(sato@net.cicc.or.jp).


200software development. The openness of thesource code also gives the chance to control theconformance to the standards of the software, aswell as the satisfaction to users’ needs.To shape consistent language supporttechnology in the country, standardizationactivities and responses to open sourcemovements are thus indispensable, and will bedescribed in this paper.1. Character SetsThe national standard character set for use incomputers is TIS 620-2533/1990, from whichseveral character sets are derived, for example,IBM code page 874 (cp-874), Microsoft codepage 874 (windows-874) and Apple Thai(MacThai) [3]. These character sets are widelyadopted in proprietary software, causingconflicts in communication among differentplatforms in the Internet.Ironically, it’s the game of the name. Only TIS620 common characters are exchanged inpractice, with different code set labels. Theresponse to the code set with “unknown” namedepends on applications. Some ignore the codeset and process the text with their defaultpreferences, while others simply reject.Ad hoc solutions are also ubiquitous, such asusing “iso-8859-1” or “x-user-defined” codename for Thai E-mails and web sites, by whichThai message could pass through the hole to thereceiver in some weak situations. But that is notalways the case.In September 1998, the “tis-620” MIMEcharacter set has been registered by TrinTantsetthi [4] with the Internet AssignedNumber Authority (IANA) of the InternetEngineering Taskforce (IETF). A campaign hasbeen set up by a group of developers [4] [5] topromote the use of the new standard MIMEcharacter set.In 1999, the international standard ISO/IEC8859-11 Latin/Thai characters has beenreactivated by the ISO/IEC JTC1/SC2/WG2,and is becoming another potential choice of thestandard MIME character set. When applied,“tis-620” and “iso-8859-11” are likely to bealiases to each other.For multilingual documents, “utf-8” [6] isanother possible alternative encoding.Nonetheless, the lack of UTF-8 editor is still theproblem.2. InternationalizationThe third edition of ISO/IEC 14651International String Ordering [7] has includedan informative annex describing Thai stringordering. And, hopefully, the ordering of Thaiin the standard would be satisfactory for Thaiusers.A principle for Thai string ordering in detail hasbeen proposed by a group of developers [8],and, as a consequence, the LC_COLLATEcategory of POSIX locale has been defined, aswell as the other categories in a later time [9].With the cooperation with the GNU C libraryproject, the drafted POSIX locale has beenmade effective with glibc 2.1.1, which is used inmodern distributions of Linux operatingsystems, such as Red Hat 6.0. Applicationsknown to be internationalized and reflect theThai locale include Linux ‘date’ and ‘cal’commands, GNOME calendar, GNOME panelclock, KDE panel clock, and Perl 5.3. FontsThai fonts currently available in the market aredesigned based on Roman font metrics. This isnot appropriate for Thai glyphs, since Thaicharacters are written in 4 levels. As a result,Thai glyphs are usually compressed toaccommodate space for the 4 levels, and looksmaller than Roman letters with the same pointsize.The National Electronics and ComputerTechnology Center (NECTEC) therefore set upa committee for drafting the standard metricsfor Thai glyphs relative to Roman and forcreating prototype fonts to be used in publicdomain.Three public-domain fonts, knowned asNational Fonts (NF) 1, 2 and 3, are nowavailable to the public. They are aimed to bethe default fonts available in every platform.NF1 and NF3 are serif fonts. NF2 is sans serif.NF4 is planned for a “calligraphic” model fontand NF5 is planned for a “handwriting” modelfont. Within December 1999, the official namesof these fonts will be announced as part of thecelebration of the 6th cycle anniversary (72ndbirthday) of His Majesty The King of Thailand.


4. Tai Scripts StudiesThai language used in the central Thailandbelongs to the Tai language family. The scriptsbelonging to the family have caught theinterests from a group of standardizationcommittees. For example, New Tai Lue and TaiDam scripts have been proposed to be encodedin the ISO/IEC 10646-1 character set.In Thailand, Mr. Thawee Sawangpanyangkoonhas done a research on Tai scripts and hascreated TrueType fonts for 13 Tai scripts,through the funding of the Thailand ResearchFund (TRF).We expect that more efforts will be made in thestudy of unification of these scripts with Thaiscripts.5. Open Source MovementsSeveral developers in Thailand have adoptedthe philosophy of open-source software in theirworks and have joined the world in thismovement. Linux, the free OS of LinusTorvald, has become popular in Thailand andmany developers have joined together inboosting the use of Thai language in the OS,with X Window as the GUI environment.5.1 DistributionsThere are currently four local Linuxdistributions in Thailand: Kaiwal Linux byKaiwal Software, Linux School Internet Server(Linux SIS) and Linux with Thai LanguageExtension (Linux-TLE) by the NationalElectronics and Computer Technology Center(NECTEC), and Burapha Linux by BuraphaUniversity. These distribution developers meetregularly and join in regular Linux/Open-Source Symposia. It is expected that somedistributions may merge in the new releases.5.2 Development ProjectsSeveral efforts are made to enable Thailanguage in open-source applications. Here aresome examples:1. NACSIS-Thai Project [10] is probablythe first effort to support Thai on variousplatforms that are not Thai-localized.2. ZzzThai [11] is another project to enable201Thai in operating systems and applicationson various platforms.3. Thai Linux Working Group [12] is aThai developer community concentratingon developments on Linux.4. WindowMaker [13] is a GNU windowmanager project based on GNUStep. TheThai XKB with language mode lockingallows user to input Thai charactersconveniently. A Thai developer has alsobeen one of the development team.5. Mozilla [14] is an open-source project setup by Netscape Communication Co., Ltd.,by opening the source code of its browserand other components. Three Thaidevelopers have contributed the Thailanguage support to the browser [15].Mozilla now can recognize the “tis-620”MIME character set, and can wrap Thaitext lines appropriately.6. Thai X Terminal is a free terminalemulator on X Window. It has beenmodified to enable Thai input/output fornatural use.7. GNU Emacs [16] now becomesmultilingual. Collaboration between ETLand NECTEC has been set to add completeThai language support and dictionarycompanion to the editor environment [17].8. MySQL [18] database server has beenmodified to sort Thai fields appropriately[19].9. Thai POSIX Locale [9] is a set of Thaicultural conventions for standard C library.It works with GNU LibC 2.1.1.10. Thai LaTeX, based on Babel package,allows Thai documents preparation onLinux.11. Thai Library is an effort to definestandard API for Thai support inapplications and to provide some chosensolutions.6. ConclusionSolutions and practices are usually one stepfurther than the standards. In such situation,interoperability problem will call for newstandards. The Internet has proven to be themain force in making new standard and


202interoperability adopted a lot faster than in thepast. More and more developers are nowjoining force in the making of standards andputting these standards to workOpen source model does not only provide ameans of cooperative development, but alsoallows the software to be standardized, and thestandard conventions to be realized. Thereforewe take both streams as our means to developour information technology for the future. Wehave illustrated the case of Thailand, which isnow gaining a tremendous trust from the opensourcemovement. The outcome is amazing:something real, usable and stable enough formission-critical applications.References[1] Thaweesak Koanantakool and the ThaiAPI Consortium. Computer and ThaiLanguage. National Electronics andComputer Technology Center, 1987. ISBN974-7570-66-1. (in Thai)[2] Thaweesak Koanantakool and AdshariyaAgsorn-intara, Character Codes andInput/Output Method for the ThaiLanguage. CICC/NACSIS/NationalElectronics and Computer TechnologyCenter, Tokyo, Japan, 1990.http://thaigate.nacsis.ac.jp/refer/thaiconf/[3] Trin Tantsetthi. An Annotated Referenceto the Thai Implementations.http://www.inet.co.th/cyberclub/trin/thairef/[4] Trin Tantsetthi. Campaign for Internet-Standard-Conforming Thai Usage.(in Thai)http://software.thai.net/tis-620/[5] Worawit Khangtrakool. TIS-620 FriendlyVersion. (in Thai)http://www.thai.net/tis-620/[6] F. Yergeau. UTF-8, a transformationformat of ISO 10646. RFC 2279. AlisTechnologies. January 1998. (ObsoletesRFC 2044)[7] Alain LaBonté. (Editor) ISO/IEC FCD14651.3 – International String Ordering– Method for comparing CharacterStrings and Description of the CommonTemplate Tailorable Ordering. June1999.[8] Theppitak Karoonboonyanan, SamphanRaruenrom and Pruet Boonma. Thai-English Bilingual Sorting.http://www.links.nectec.or.th/~thep/blsort.html[9] Theppitak Karoonboonyanan. ThaiLocale.http://www.links.nectec.or.th/~thep/thlocale/[10] National Center for Science InformationSystems. NACSIS-Thai Project.http://thaigate.rd.nacsis.ac.jp/[11] uecthai@fedu.uec.ac.jp. ZzzTh@i : Howto use Thai with various computerplatforms.http://zzzthai.fedu.uec.ac.jp/[12] Thai Linux Working Group. Thai LinuxWorking Group.http://linux.thai.net/[13] Alfredo K. Kojima. WindowMaker.http://www.windowmaker.org/[14] The Mozilla Organization. Mozilla.org.http://www.mozilla.org/[15] Samphan Raruenrom. Mozilla ThaiEnabling.http://developer.thai.net/mozilla/[16] Free Software Foundation. GNU Emacs.http://www.gnu.org/software/emacs/emacs.html[17] Software and Language EngineeringLaboratory, NECTEC. Thai LanguageSupport for Emacs.http://www.links.nectec.or.th/themacs/[18] T.c.X DataKonsultAB. MySQL by T.c.XDataKonsultAB.http://www.mysql.net/[19] Pruet Boonma. Thai Sorting Support forFree Database Server.http://linux.intanon.nectec.or.th/thaisortdatabase.htmlBIOGRAPHIESTheppitak KaroonboonyananTheppitak Karoonboonyananreceived hisB.Eng. (ComputerEngineering 2 nd classh o n o r ) f r o m


203Chulalongkorn University in 1993. He joinedthe Software and Language EngineeringLaboratory (SLL), NECTEC since August 1995as a research assistant. His experience includesThai word processor and the Royal InstituteDictionary CD-ROM. This made him interestedin Thai algorithms and implementations. He hasalso been involved in a number of Thai opensourceprojects, such as Thai POSIX locale. Hisinterests include object-oriented softwareengineering and artificial intelligence.Dr. Thaweesak KoanantakoolDirector of NECTECDr. Thaweesak "Hugh"Koanantakool receivedhis Bachelor and Ph.D.degrees in ElectricalEngineering fromImperial College ofScience and Technology,London University. Hehad a number ofindustrial contracts in theUK before he came back to Thailand to start hisgovernment service career in 1981. He taught inElectrical Engineering with the Faculty ofEngineering, Prince of Songkla University. In1985, he moved to Bangkok, ThammasatUniversity, and was appointed AssociateDirector of the Information Processing Institutefor Education and Development. Since 1994, hebecame Deputy Director of NECTEC as well asleading the Network/Software Technology labs.Thaweesak introduced the Internet intoThailand and set up the largest academic andresearch network known as ThaiSarn underNECTEC. He later co-founded the first InternetService Provider (ISP) owned by Thaigovernment in 1995. The ISP, Internet ThailandCompany Limited, at present is the largest ISPin Thailand, has 45% market share (by IPnumbers managed). In 1996-1997, Thaweesakled Thailand's Information Superhighway testbed Project funded by NECTEC. The projectwas a major test bed in Thailand using ATMswitches for both local area and wide-areas. InAugust 1998, Thaweesak was appointed theDirector of NECTEC.


204LETTERSDear all,On behalf of the editor-in-chief of NTJ, Iwould like to express my appreciation to allauthors who submitted papers, reviewers, andwho all have contributed to the success ofNTJ up to this point. I am very glad to informyou that, during this period of time, there willbe two well-known conferences taking placein Thailand. One is a 1999 IEEE InternationalSymposium on Intelligence Signal Processingand Communication Systems (ISPACS'99)and the other is the 1999 National ComputerScience and Engineering Conference(NCSEC'99).ISPACS'99ISPACS'99 will be held during December 8-10, 1999 at Phuket Arcadia Hotel & Resort.In the symposium, there will be about 200papers for presentation in 4 parallel tracks of24 lecture sessions and 1 track of 6 postersessions, with 2 special sessions on Thailanguage processing and VLSI architecture.There are two tutorial sessions : "MPEG-4"by K.R. Rao from university of Texas atArlington, "Wireless TelecommunicationTechniques for Fading and InterferenceEnvironments" by Takis Mathiopoulos fromuniversity of British Columbia. Futhermore,there are four keynote speeches :"Challenges in Realizing the MultimediaMobile Communications Era : IMT-2000and Beyond" by Fumiyuki Adachi from NTTMobile Communications Network, Inc., "ADynamic Networking Architecture Networksfor the Next Generation" by Norio Shiratorifrom Tohoku University, "New Challenge ofVLSI Design in System-on-Silicon Era" byHiroaki Kunieda from Tokyo Institute ofTechnology, and "Intelligent SignalProcessing in Wireless Systems" by H.Vincent Poor from Princeton university.This symposium is sponsored by IEEECommunication Society, NSTDA, NECTEC,JICA, SIIT. For more information, pleasecontact ISPACS'99 secretariat office at 662-7372500 ext. 5023, 5024, e-mail : ispacs99@kmitl.ac.th, and http://www.kmitl.ac.th/~reccit.NCSEC'99NCSEC'99 is the only national conferencededicated specifically for the fields ofComputer Science and ComputerEngineering. It will be held on December 16-17, 1999 at Landmark Hotel, Bangkok. Over55 papers will be presented in 3 paralleltracks of 16 lecture sessions and 2 postersessions. Two especially large sessions are onThai Character Processing and on IntelligentSystems.Besides the paper presentation, a paneldiscussion on the topic “SoftwareEngineering in Computer Science andComputer Engineering Education” isspecially conducted in order to reflex thenational need for this particular technologicaldevelopment.Four tutorial sessions consist of “High-Performance Numerical Linear Algebra:Fast and Robust Kernels for ScientificComputing” by Jack Dongarra fromUniversity of Tennessee at Knoxville andOak Ridge National Laboratory, USA,“Bayesian Networks” by Peter Haddawyfrom Assumption University and Universityof Wisconsin at Milwaukee, “GeneticAlgorithm and Its Applications” by PrabhasJongsatitwattana from ChulalongkornUniversity, and “Education System Reformin the Next Millennium – A Case Study” byYuen Poovarawan from Kasetsart University.A special corner will also be dedicated to theexhibition and a series of brief presentationsabout “Linux Clustering” headed byPutchong Uthayopas from KasetsartUniversity.On December 16, The keynote speech byJack Dongarra will be on the topic “High-Performance Computing and Netsolve: ANetwork Server for Solving ComputationalScience Problems”. On December 17, therewill be an invited talk by Thaweesak


Koanantakool, director of the NationalElectronics and Computer Technology Center(NECTEC).The NCSEC committee consists of a numberof lecturers and researchers from manyuniversities in Thailand. NCSEC’99 is hostedby Department of Computer Science, Facultyof Science and Technology, AssumptionUniversity, and is sponsored by AssumptionUniversity and NECTEC. For moreinformation, please contact 300-4543 – 53ext. 3680..2, e-mail : ncsec99@s-t.au.ac.thand http://www.s-t.au.ac.th/~ncsec99.I hope these two conferences will stimulatebasic researches in our beloved country to befull with a sense of well-being and willsolidify the freindship among the computerscientists and engineers in the fields.Furthermore, there is a letter from Assoc.Prof. Preecha Yupapin states fact about basicresearches in Thailand in the field of optics. Ihope it contains a valuable information foroptics interested groups of people. Lastly, Iwould like to cordially invite you to submitpapers, tutorials, and letters to our NECTECTechnical Journal to disseminate knowledgeto the public.Chularat TanprasertEditor-in-ChiefResearch in Optics TechnologyWe are recognized that basic research inscience and technology as much as productoriented development firmly economicalgrowth. Optics is one of the major subjectswhich is popularly studied in the next decade.Astonishing as the demand forwavelength division multiplexing, (WDM)has been rapidly growth for the use in WDMsystems. Each category of components hasexperienced this rise, including lasers,multiplexers and demultiplexers, andamplifiers. The trend toward blending205DWDM and data transport technologies iscreating new opportunities for optical adddropmultiplexers and cross-connects.Optics research in Thailand is increased in thenext century due to the demand of technologyand industry. Optical technology has shownthe advantage such as the use incommunication for high speed communications,optical computer, holographic movie,optical metrology and medical optics, etc.,which may be divided into the followinggroups.Optical TheoryThis group studies the basic theory in opticsconcerning optical properties and relatedareas, for examples, physical optics,geometrical optics, holography andmetrology. These areas are studied to supportthe experimental groups. Numerical methodis also used for the prediction of thetheoretical study in wide area of research.Fiber OpticsFiber optics with the applications in eithercommunication or sensors are studied in thisgroup, heading for principle of new devicesand technologies such as optical switching,optical filter, optical signal processing, i.eWDM technology and the use of plasticoptical fibers, nonlinear properties such asoptical bistability or chaotic switches, solitonand fiber amplifier.Photonic MaterialsThe searching of new materials for photonicdevices are focused in this group. Thesedevices are concerned about the materialapplications for transmitters, receivers andmodulators, where the applications can bemore useful and helpful if the devicecharacteristics can be described concerningthe realistic applications.Laser Applications


206This group uses laser to study the opticalmaterial in the form of thin film which areconcerned their optical properties,. Thematerial processing by laser is alsoinvestigated, where the application linking tothe industry is the major activities of thisgroup. Laser theory is also studied in thisgroup. The designing of laser system, lasercavity and components are also in the plan oftheir research.Department of Applied Physics,Faculty of Science, KMITLOptoelectronic DevicesThey work on quantum well devices fortransmission and detection, either for sensorsor communications which is widely exploredbased on semiconductor and quantum welldevices. The devices characteristics are alsostudied with networking control.Acousto-OpticsThis group is focussed on the use of acoustoopticmodulator for optical communication,i.e. external moderation either experimentalor theretical works.Magneto-OpticsThey work are the study of optical propertiesof magnetic material which is focussed on thetechnique to serve either basic research andapplications in science and technology.KMITL is known as a leadership institutionin applied science and technology, where thebasic optical research and technology hasbeen taken place in either science andengineering faculties. There are 8 researchand development (R&D) groups with a totalof 50 researchers working in opticaltechnology and related fields. There is aPh.D. program by research which has beenestablished in the Department of AppliedPhysics, Faculty of Science in either nationalor international programs.Assoc.Prof. Dr. Preecha YupapinLightwave Technology Research Center,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!