±Û¾´»ç¶÷ °ü¸®ÀÚ
±Û¾´½Ã°£2003³â 10¿ù 14ÀÏ ¿ÀÈÄ 1½Ã 39ºÐ 59ÃÊ
    Á¦¸ñ[¹ø¿ª] JSP Application Design with MVC
¿ø¹®Àº

O'REILLY JavaServer Pages 2nd Ed.
By Hans Bergsten
2nd Edition August 2002

ÀÔ´Ï´Ù. Âü°í·Î ¾Æ¸¶Á¸ÆòÁ¡ÀÌ Á» ´õ ÁÁÀº ´Ù¸¥ Ã¥µµ ÀÖ½À´Ï´Ù.
±×¸®°í °ø°³µÈ »ùÇÃéÅÍ¿¡ µé¾îÀÖ´Â ³»¿ëÀÌ¶ó ¹ø¿ªÇؼ­ °ø°³Çصµ
¹®Á¦°¡ µÉ°Å °°Áö´Â ¾Ê³×¿ä.




3.4 JSP Application Design with MVC

JSP technology can play a part in everything from the simplest web application,
such as an online phone list or an employee vacation planner, to full-fledged
enterprise applications, such as a human-resource application or a sophisticated
online shopping site. How large a part JSP plays differs in each case, of course.
In this section, I introduce a design model called Model-View-Controller (MVC),
suitable for both simple and complex applications.

JSP ±â¼úÀº ÀüÈ­¹øÈ£ºÎ³ª Á÷¿øÈÞ°¡ÀÏÁ¤°ú °°Àº °£´ÜÇÑ À¥¾îÇø®ÄÉÀ̼ǿ¡¼­ºÎÅÍ
±¸Àα¸Á÷, Á¤±³ÇÑ ¼îÇθô µîÀÇ ¼º¼÷ÇÑ ±â¾÷ ¾îÇø®ÄÉÀ̼ǿ¡ À̸£±â±îÁö ¸ðµç ºÐ¾ß¿¡¼­
À¯¿ëÇÏ´Ù. .. ³ª´Â °£´ÜÇϰųª º¹ÀâÇÑ ¾îÇø®ÄÉÀ̼ǿ¡ ¸ðµÎ ÀûÇÕÇÑ ¸ðµ¨-ºä-ÄÁÆ®·Ñ·¯
(MVC: Model-View-Controller) ¶ó´Â ¼³°è ¹æ¹ýÀ» ¼Ò°³ÇÏ·Á°í ÇÑ´Ù.

MVC was first described by Xerox in a number of papers published in the late
1980s. The key point of using MVC is to separate logic into three distinct units:
the Model, the View, and the Controller. In a server application, we commonly
classify the parts of the application as business logic, presentation, and
request processing. Business logic is the term used for the manipulation of an
application's data, such as customer, product, and order information.
Presentation refers to how the application data is displayed to the user, for
example, position, font, and size. And finally, request processing is what ties
the business logic and presentation parts together. In MVC terms, the Model
corresponds to business logic and data, the View to the presentation, and the
Controller to the request processing.

MVC´Â Á¦·Ï½º°¡ 80³â´ë¸» ¹ßÇ¥ÇÑ ¿©·¯ ³í¹®¿¡¼­ óÀ½ ¼³¸íµÇ¾ú´Ù. MVC ÀÇ ÇÙ½ÉÀº
ÇÁ·Î±×·¥·ÎÁ÷À» ¼¼ °³ÀÇ À¯´Ö [ ¸ðµ¨, ºä, ÄÜÆ®·Ñ·¯ ] ·Î ºÐ¸®ÇÏ´Â °ÍÀÌ´Ù.
¼­¹ö¾îÇø®ÄÉÀ̼ǿ¡¼­´Â [ ºñÁî´Ï½º·ÎÁ÷, ÇÁ·¹Á¨Å×À̼Ç, ¸®Äù½ºÆ®ÇÁ·Î¼¼½Ì ] À¸·Î
¾îÇø®ÄÉÀÌ¼Ç ±¸¼º¿ä¼Ò¸¦ ºÐ·ùÇÑ´Ù. ºñÁî´Ï½º·ÎÁ÷Àº °í°´,»óǰ,ÁÖ¹® Á¤º¸µî°ú °°Àº
¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅÍÀÇ Ã³¸®¸¦ ¸»ÇÒ ¶§ ¾²´Â ¿ë¾îÀÌ´Ù. ÇÁ·¹Á¨Å×À̼ÇÀº ÀÌ·¯ÇÑ
µ¥ÀÌÅͰ¡ »ç¿ëÀÚ¿¡°Ô ¾î¶»°Ô º¸¿©Áö´À³Ä¸¦ ÀǹÌÇÑ´Ù. ¿¹¸¦µé¾î µ¥ÀÌÅÍÀÇ À§Ä¡,
±ÛÀÚÀÇ Á¾·ù³ª Å©±â µîÀ» ¸»ÇÑ´Ù. ¸¶Áö¸·À¸·Î ¸®Äù½ºÆ®ÇÁ·Î¼¼½ÌÀº ºñÁî´Ï½º·ÎÁ÷°ú
ÇÁ·¹Á¨Å×ÀÌ¼Ç ¿µ¿ªÀ» ¿¬°áÇØÁÖ´Â ºÎºÐÀ» ¸»ÇÑ´Ù. MVC ¿ë¾î¿¡ À־, ¸ðµ¨Àº
ºñÁî´Ï½º·ÎÁ÷°ú µ¥ÀÌÅÍ¿¡, ºä´Â ÇÁ·¹Á¨Å×À̼ǿ¡, ÄÜÆ®·Ñ·¯´Â ¸®Äù½ºÆ®ÇÁ·Î¼¼½Ì¿¡
ÇØ´çµÈ´Ù.

Why use this design with JSP? The answer lies primarily in the first two elements.
Remember that an application data structure and logic (the Model) is typically
the most stable part of an application, while the presentation of that data
(the View) changes fairly often. Just look at all the face-lifts many web sites go
through to keep up with the latest fashion in web design. Yet, the data they
present remains the same. Another common example of why presentation should be
separated from the business logic is that you may want to present the data in
different languages or present different subsets of the data to internal and
external users. Access to the data through new types of devices, such as cell
phones and personal digital assistants (PDAs), is the latest trend. Each client
type requires its own presentation format. It should come as no surprise, then,
that separating business logic from the presentation makes it easier to evolve an
application as the requirements change; new presentation interfaces can be
developed without touching the business logic.

¿Ö JSP ¸¦ °¡Áö°í ÀÌ·¸°Ô ¼³°è¸¦ ÇÒ±î? ±× ´äÀº ¿ì¼± ¾ÕÀÇ µÎ ¿ä¼Ò¿¡ ÀÖ´Ù.
¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅͱ¸Á¶¿Í ·ÎÁ÷(¸ðµ¨)Àº ÀüÇüÀûÀ¸·Î °¡Àå ¾ÈÁ¤µÈ ¿µ¿ªÀ̰í, ¹Ý¸é¿¡
±×·¯ÇÑ µ¥ÀÌÅÍÀÇ ÇÁ·¹Á¨Å×À̼Ç(ºä)Àº »ç½Ç ÀÚÁÖ º¯°æµÈ´Ù´Â Á¡À» »ó±âÇØº¸ÀÚ. ´ÜÁö
À¥µðÀÚÀÎÀÇ ÃÖ±Ù À¯ÇàÀ» µû¸£±â À§ÇØ ¸¹Àº À¥½ÎÀÌÆ®°¡ °Þ´Â ¸ðµç ¼ºÇü¼ö¼úÀ»
ÁÖ¸ñÇØº¸ÀÚ. ±×·¯³ª À¥½ÎÀÌÆ®°¡ º¸¿©ÁÖ´Â µ¥ÀÌÅÍ¿¡´Â º¯ÇÔÀÌ ¾ø´Ù. ÇÁ·¹Á¨Å×À̼Ç
·ÎÁ÷ÀÌ ºñÁî´Ï½º·ÎÁ÷¿¡¼­ ºÐ¸®µÇ¾î¾ß ÇÏ´Â ¶Ç ´Ù¸¥ Æò¹üÇÑ ¿¹·Î, ±¹³»¿ÜÀÇ
»ç¿ëÀÚ¿¡°Ô ´Ù¾çÇÑ ¾ð¾î·Î µ¥ÀÌÅ͸¦ º¸¿©ÁÖ°í ½ÍÀ» ¼ö ÀÖ´Ù. (¿ªÀÚ ÁÖ: ÀÌ °æ¿ì´Â
µ¿ÀÏ ÅÛÇø´¿¡ ´Ù¸¥ µ¥ÀÌÅÍÇÒ´çÀ» ¸»ÇÏ´Â °Í °°½À´Ï´Ù.) ÇÚµåÆùÀ̳ª PDAs ¿Í °°Àº
»õ·Î¿î ÀåÄ¡µé¿¡ ´ëÇÑ µ¥ÀÌÅÍ󸮴 ÃÖ±ÙÀÇ °æÇâÀÌ´Ù. °¢ Ŭ¶óÀÌÀÌ¾ðÆ® À¯ÇüÀº
±×¿¡ ¸Â´Â ÇÁ·¹Á¨Å×ÀÌ¼Ç Æ÷¸ËÀ» ¿ä±¸ÇÑ´Ù. ±×·¸´Ù¸é, ºñÁî´Ï½º·ÎÁ÷°ú
ÇÁ·¹Á¨Å×À̼ÇÀ» ºÐ¸®ÇÔÀ¸·Î½á ÀÌ·¯ÇÑ ¿ä±¸ÀÇ º¯°æ¿¡ µû¶ó ¾îÇø®ÄÉÀ̼ÇÀ»
ÁøÈ­½ÃŰ±â ½±´Ù´Â °ÍÀº ³î¶ó¿î ÀÏÀÌ ¾Æ´Ï´Ù. ºñÁî´Ï½º·ÎÁ÷À» º¯°æÇÏÁö ¾Ê°í »õ·Î¿î
ÇÁ·¹Á¨Å×ÀÌ¼Ç ÀÎÅÍÆäÀ̽º¸¦ °³¹ßÇÒ ¼ö ÀÖ´Ù.
±âÈÆ jsp? »õ·Î¿î°Å ÁغñÇϽóª¿ä? ^^
¾Æ~ ¼ÒÁÖ »ý°¢³ª´Â ÇÏ·ç~ ¾ó¸¥ ¾÷¹« ¸¶Ä¡°í ÇÑÀÜÇØ¾ß°Ú½À´Ï´Ù.
ÁÁÀº ÇÏ·ç µÇ¼¼¿ä ^^
03-10-14 16:03
±âÈÆ ÀÎŬ·çµå ÇÒ¶§¿ä
ÆÄÀÏ ¾ÆÀ̵ð ¾Õ¿¡ '>' ¸¦ ºÙÀ̸é, PHP ÆÄÀÏÀ» ÀÎŬ·çµåÇÒ ¼ö ÀÖ½À´Ï´Ù
ÀÌ·¸°Ô µÇ¾îÀִµ¥ < À̰нá¾ßÇϴ°Š¾Æ´Ñ°¡¿ä?
03-10-14 16:24
°ü¸®ÀÚ ">"  ÀÌ°Ô ¸Â½À´Ï´Ù. ¹ö±×³×¿ä.;;  ¼Ò½ºÀÇ define() ¿¡¼­ < ¸¦ > ·Î ¹Ù²Ù½Ã±â ¹Ù¶ø´Ï´Ù.

¹ø¿ªÀº.. ¸·»ó Àо¸é, Ưº°ÇÑ ³»¿ëÀº ¾ø´Â °Å °°Áö¸¸ ÅÛÇø´ ±âº»°³³ä¿¡ ´ëÇØ ¿ë¾îÁ¤¸®°¡ Àß µÇ¾î Àִ°Š°°³×¿ä.
03-10-14 17:10
°ü¸®ÀÚ ¿äÁò ¼ú ¾ê±â ÀÚÁÖÇϽó׿ä. ÇÔ ÇÑ ÀÜ ÇÒ±î¿ä.
03-10-14 17:23
±âÈÆ ÁÁÁÒ~ ³¯Çѹø ÀâÁÒ~
03-10-14 17:55
°ü¸®ÀÚ ÀÌ ¹ø ÁÖ ¾Æ¹« ¶§³ª ÁÁ½À´Ï´Ù. ¿©±ä 3È£¼± °í¼Ó¹ö½ºÅ͹̳οª ±Ù¹æÀ̰í.. °­³²¿ª ÂÊÀÌ ÁÁÀ»±î¿ä. ½Ã°£ Àå¼Ò Á¤Çؼ­ ¾Ë·ÁÁÖ¼¼¿ä.
03-10-14 18:04
±âÈÆ ±Ý¿äÀÏ ¾î¶°½Å°¡¿ä~ ±Ý¿äÀϳ¯ Á¦°¡ ±×¸®·Î °¥²²¿ä~
¾Æ´Âµ¥´Â ¾ø°í ÀεµÇÏ¿©ÁÖ¼Ò¼­ ¤Ì¤Ñ
03-10-14 18:19
°ü¸®ÀÚ È¸»ç°¡ »ç´çÀ̶ó°í Çß´ø ±â¾ïÀÌ.. ±×·³.. ±Ý¿äÀÏ 7½Ã 30ºÐ °­³²¿ªÀ¸·Î.. ½Ã°£ÀÌ ÀûÀýÇÑÁö ¸ð¸£°Ú³×¿ä. ¾Æ´Ï¸é ¸»¾¸ÇϽñ¸¿ä. ÀÚ¼¼ÇÑ ³»¿ëÀº ´çÀÏ °Ô½ÃÆÇ¿¡..
03-10-14 18:24
ÀÌÁؼº ¾îÇã¶ó....¸ðÀδٴ ¸»ÀÌÁÒ....¾ÈŸ±î¿ö¶ó....
03-10-14 23:53
°ü¸®ÀÚ ¾ÈŸ±õ³×¿ä^^
03-10-15 08:26
´À³¦Ç¥ 2³âÀü¿¡ ¸¸³ª½Ã°í ¾È¸¸³ª¼Ì³ªº¸´Ù~ 03³âÀÌÈÄ ±ÛÀÌ ¾ø´Ù ^^
06-02-20 10:19
¹°À½Ç¥ http://www.xtac.net/bbs/?prc=read&idx=790
06-02-23 11:14
    À̸§
ºñ¹Ð¹øÈ£
 
2003-03-03 ~