레이블이 닷넷교육인 게시물을 표시합니다. 모든 게시물 표시
레이블이 닷넷교육인 게시물을 표시합니다. 모든 게시물 표시

2013년 10월 19일 토요일

[Spring Container에서 자바빈 로딩하는 방법2가지]Spring Framework Lazy Loading, Pre Loading, BeanFactory, ApplicationContext

[Spring Container에서 자바빈 로딩하는 방법2가지]Spring Framework Lazy Loading, Pre Loading, BeanFactory, ApplicationContext
 
스프링 프레임워크에서 자바빈을 로딩(인스턴스로 만든 후 바인딩)하는 데 있어 두가지 방법을 제공한다.

두 방법은 lazy biding, pre-loading 이다.
 
1. Lazy Binding
 
자바빈이 다른 메소드 또는 클래스의 요청에 의해 호출되는 시점에 로드되는 방법이다.

org.springframework.beans.factory.BeanFactory와 하위클래스들이 사용하는 방법으로 스프링 컨테이너에서는 관련빈을 호출되는 시점에 로딩한다.
 
아래 예를 보자.
 
BeanFactory factory = new XmlBeanFactory(
                        new InputStreamResource(
                        new FileInputStream("onj.xml")));    
             
OrderManager orderManager = (OrderManager) factory.getBean("orderManager"); 

우선 위 예문의 경우 onj.xml이 메모리에 로딩되더라도 orderManager 빈은 인스턴스화 되지 않는다.  즉 getBaean("orderManager")하는 순간 메모리로 올라오는 것이다.

결국 getBean 메소드가 호출되는 시점에 할 일이 많아 지는 것이다.

2. Pre-Loading
 
컨테이너에서 XML 파일을 로딩하자 마자 정의된 자바빈들을 로딩하는 방법.

org.springframework.context.ApplicationContext가 수행한다.
 
//모든 싱글톤 자바빈들이 메모리로 로딩
ApplicationContext context =
            new ClassPathXmlApplicationContext("onj.xml");
           
//필요한 빈을 리턴           
OrderManager orderManager = (OrderManager) context.getBean("orderManager");

2013년 10월 12일 토요일

22. 스프링3.X 게시판(Spring AOP적용, DAO단 DML문 실행시 로깅, 스프링 충고 spring advice) Spring Framework3.2 게시판 2단계 : 지금까지 구현한 게시판의 기본 기능에 Spring AOP를 적용하여 충고(Advice)를 적용하자.

22. 스프링3.X 게시판(Spring AOP적용, DAO단 DML문 실행시 로깅, 스프링 충고 spring advice)
 
Spring Framework3.2 게시판 2단계 : 지금까지 구현한 게시판의 기본 기능에 Spring AOP를 적용하여 충고(Advice)를 적용하자.

onj.board.dao.SpringBoardDAO.java의 insert, update, delete등 DML문장 실행시 로그를 남기기 위해 ...

1. 로깅을 위해 Oracle Table 만들자.

SQL> create table boardlog (
          methof varchar2(50),
   sql varchar2(1000),
   ilsi date);
 
2. Spring AOP용 Aspect(Pointcut + advice)를 만들자.(LogginAspect.java)
 
package onj.board.aop;
 
import onj.board.dao.BoardDAO;
import onj.board.dao.LoggingDAO;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.AfterReturning;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
@Aspect
public class LoggingAspect {
 @Autowired
 private LoggingDAO loggingDAO;
 
 @Autowired
 private BoardDAO boardDAO;
 // 사후충고(반드시 정상 리턴 후 호출)
 // SpringBoardDAO의 모든메소드중 파라미터가 1개 있는 메소드가 충고받을 포인트컷
 // 본 게시판에는 리스트보기와 , getSql() 만 메소드 파라미터가 없어 충고 적용 안됨
 @AfterReturning(pointcut="execution(* onj.board.dao.SpringBoardDAO.*(*))", returning="result")
 public void logAfterReturning(JoinPoint joinPoint) {
System.out.println("<<<<<<<<< DAO 로깅 충고 실행");  
  loggingDAO.writeLog(joinPoint.getSignature().getName(), boardDAO.getSql());  
 }
}

3. 로그를 DB에 넣을 DAO단 클래스 제작. LoggingDAO.java

package onj.board.dao;
 
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@Component("loggingDAO")
public class LoggingDAO {
 private JdbcTemplate jdbcTemplate;
 @Autowired
 private DataSource dataSource;
 public JdbcTemplate getTemplate() {
  if (jdbcTemplate == null) {
   this.jdbcTemplate = new JdbcTemplate(dataSource);
  }
  return jdbcTemplate;
 }
 // DAO단 쿼리 로깅
 public int writeLog(String mehtodName, String dml)
   throws DataAccessException {
  //로그용 테이블에 로그 저장
  String sql = "insert into boardlog(method, sql, ilsi) values (? , ? ,sysdate) ";
  
  Object[] obj = { mehtodName, dml };
  return getTemplate().update(sql, obj);
 }
}
 

4. boardConfig.xml에 aspect 추가
 <aop:aspectj-autoproxy/>
 <context:component-scan base-package="onj.board.dao"/>
 <context:component-scan base-package="onj.board.service"/> 
 
 <bean id="myLogger" class="onj.board.aop.LoggingAspect" />
 
</beans> 

5. [결과확인]
 
10월 09, 2013 2:13:52 오후 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
10월 09, 2013 2:13:52 오후 org.apache.catalina.startup.Catalina start
INFO: Server startup in 3491 ms
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행
<<<<<<<<< DAO 로깅 충고 실행

boardlog 테이블을 select 해보라!!

오라클자바커뮤니티에서 설립한 개발자교육6년차 오엔제이프로그래밍 실무교육센터(오라클SQL,튜닝,힌트,자바프레임워크,안드로이드,아이폰,닷넷 실무개발강의)  

[개강확정강좌]오라클자바커뮤니티에서 운영하는 개발자 전문교육 ,개인80%환급(www.onjprogramming.co.kr)






2013년 8월 9일 금요일

C# 명령문, 반복문

이번 강좌에서는 제어문 또는 명령문에 대해 보도록 합니다. 기존 언어와 매우 유사하니 간단히 살펴 보도록 하겠습니다.


  오라클자바커뮤니티에서 설립한 오엔제이프로그래밍 실무교육센터
(오라클SQL, 튜닝, 힌트,자바프레임워크, 안드로이드, 아이폰, 닷넷 실무전문 강의)  



먼제 선택을 위한 if, switch 문에 대해 보도록 하겠습니다.

1. if문

if statement : 어떤 조건의 참, 거짓을 판단하여 실행을 제어하는 구조에 사용되는 statement 입니다.

condition 부분은 결과값은 반드시 true또는 false가 되어야 합니다.(No implicit conversion from int to bool )

다른 언어들의 경우: 0 이나 -1을 false로 나머지를 true로 암시적 형 변환

int x;

if(x) …//must be if (x!=0) in c#
if(x=0) …//must be if (x==0) in c#

[예]

enum Suit { Clubs , Hearts , Diamonds , Spades };

Suit trumps = Suit.Hearts;
if ( trumps == Suit.Clubs )
color = "Black";
else if ( trumps == Suit.Hearts )
color = "Red";
else if ( trumps == Suit.Diamonds )
color = "Red";
else
color ="Black";



2. switch 문

switch문의 변수값과 일치하는 case로 분기 합니다. (진입점)

변수값 일치하는 case가 없을 경우 default로 분기 합니다.

break문을 만나면 switch문 외부로 분가 합니다. (종단점)

[예]

switch(trumps) {
case Suit.Clubs:
case Suit.Spades:
color = "Black" ; break;
case Suit.Hearts:
case Suit.Diamonds:
color = "Red" ; break;
default:
color = "ERROR"; break;

}


다음은 반복문에 대해 보도록 합니다. (while, do~while, for, foreach)

1. while문

형식:

while (condition)
{
statements;
}

조건이 참인 동안에 statement를 실행 합니다.

[예]

int Index = 0;

while (Index < 10 ) {
Console.WriteLine(Index);
Index++;
}


2.do~while문

형식 :

do{
statements;
} while (condition);


while문과의 차이는 조건에 맞지 않더라도 statement를 한번은 수행하는 구조 입니다. 그러나 while문에서는 조건에 맞지 않으면 statement를 한번도 수행 하지 않을수도 있습니다.

[예]

int Index = 0;

do {
Console.WriteLine(Index);
Index++;
}while(Index < 10 )




3. for문

형식:

for(초기치; 조건; 업데이트 실행){
statements;
}

일반적인 for문과 같으므로 별다른 설명은 하지 않겠습니다.

[예]

for ( int x=0; x < 10 ; x++) { //x는 0부터 10보다 작을때 까지 x를 1씩 증가하면서 x의 값을 찍으니 0부터 9까지 출력되겠죠...
Console.WriteLine(x);
}

아래와 같은것도 되는것 아시죠^^;

for ( int x=0 , y = 0 ; x < 10 , y< 100 ; x++ , y++)



4. foreach문

형식:

foreach(item in 배열 또는 컬렉션){
statements;
}
배열: 여러 개의 데이터를 하나의 변수 또는 객체에 담아두는 것
컬렉션: 자유로운 형태로 여러 개의 데이터를 담아둘 수 있습니다. ArrayList, HashTable, Icollection 등이 있습니다.

실행순서를 설명 드리면 배열이나 컬렉션에서 하나의 항목을 읽은 후 statement를 수행하고 다음 foreach로 가서 다음 읽을것이 있으면 다시 읽고 statement를 실행하는 순서로 동작 합니다. 만약 다음 읽을것이 없다면 루프를 빠져 나옵니다.

[예]

ArrayList numbers = new ArrayList();

for ( int I= 0 ; I < 10 ; I++) {
Numbers.Add(I); //0부터 9까지의 수를 ArrayList라는 컬렉션에 담는다. C#에서 모든 데이터형은 객체 임
}

foreach(int number in numbers ) { //컬렉션에 객체가 있는 동안에 반복해서 그 값을 출력함, foreach를 사용하면 종료 조건을 기술하지 않아도 되므로 상당히 효율적
Console.WriteLine(number);
}




이번에는 제어를 조절할 수 있는 break,continue에 대해 알아 보겠습니다.

break : 반복문 내의 임의의 지점에서 루프를 빠져나가야 할 때 break문을 사용 합니다. 싸고 있는 루프중 가장 가가운 루프를 빠져 나갑니다.
continue : 루프의 남은 부분을 skip하고 루프의 처음으로 제어를 옮깁니다.

[ORACLEJAVA커뮤니티 .NET교육, JAVA교육]닷넷(C#)으로 만든 주소록 예제

닷넷 주소록은 Visual Studio .Net 에서 작성하시면 되구요 ... 대충 보시면 이해가 되겠지만 ADO.Net을 사용한 예제이며 DB는 오라클을 사용 했습니다.
(주소에 대한 입력/수정/삭제 가능하구요, 검색도 되는 멋진 주소록 입니다.)

Oracle의 Scott에 아래의 주소록 테이블을 만드신 후 실습 바랍니다.
/*
*
* 실습용 Table script
create table AddrBook (
name varchar2(20) not null primary key,
sex varchar2(2) not null constraint ck_sex check (sex in ('M','F')),
addr varchar2(50),
tel varchar2(20) not null
)
*
* */

오라클자바커뮤니티에서 설립한 오엔제이프로그래밍 실무교육센터
(오라클SQL, 튜닝, 힌트,자바프레임워크, 안드로이드, 아이폰, 닷넷 실무전문 강의)  



--------------------------------------------------------------------
Visual Studio .Net을 실행 하신 후 C#, Window 응용 프로그램을 선택, 프로젝트 이름은 주소록으로 주시기 바랍니다.

AddrBook.cs와 CodeFile1.cs 두개의 파일을 만들어 주시면 됩니다. CodeFile1은 AddrBook.cs에서 DB 처리 부분을 탇게될 라이브러리 형태 입니다. AddrBook.cs 파일을 만들려면 새프로젝트가 시작된 상태에서 우측의 솔루션 탐색기에서 주소록에서 마우스 우측 버튼을 눌러 추가 --> 구성요소 추가 --> 새항목 추가 --> 윈도우 폼을 하시고 CodeFile1.cs의 경우 CodeFile 로 하자구요~

우선 아래의 AddrBook.cs를 다 입력하고 나면 저절로 디자인 화면에 아래처럼 디자인된 화면이 나타날겁니다. 물론 실제 개발하면 대부분의 GUI 프로그램 처럼 먼저 디자인을 하고 나중에 필요한 스크립트를 추가하는 형태가 되겠죠...

-------------------------
1. AddrBook.cs
-------------------------
using System;
using System.Data.OleDb;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace medical
{
///

/// CDJohap에 대한 요약 설명입니다.
///

public class AddrBook : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ColumnHeader Gubun;
private System.Windows.Forms.ColumnHeader JohapCd;
private System.Windows.Forms.ColumnHeader JohapNm;
private System.Windows.Forms.ColumnHeader Bigo;
private System.Windows.Forms.Button btnNew;
private System.Windows.Forms.Button btnInput;
private System.Windows.Forms.Button btnUpdate;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.TextBox txtAddr;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.TextBox txtTel;
private System.Windows.Forms.ComboBox comSex;
private System.Windows.Forms.TextBox txtSearchName;
///

/// 필수 디자이너 변수입니다.
///

private System.ComponentModel.Container components = null;

public AddrBook()
{
//
// Windows Form 디자이너 지원에 필요합니다.
//
InitializeComponent();
//
// TODO: InitializeComponent를 호출한 다음 생성자 코드를 추가합니다.
//
}
///

/// 사용 중인 모든 리소스를 정리합니다.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///

/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
///

private void InitializeComponent()
{
this.Gubun = new System.Windows.Forms.ColumnHeader();
this.JohapCd = new System.Windows.Forms.ColumnHeader();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnSearch = new System.Windows.Forms.Button();
this.txtSearchName = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtAddr = new System.Windows.Forms.TextBox();
this.JohapNm = new System.Windows.Forms.ColumnHeader();
this.listView1 = new System.Windows.Forms.ListView();
this.Bigo = new System.Windows.Forms.ColumnHeader();
this.txtName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtTel = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.comSex = new System.Windows.Forms.ComboBox();
this.btnNew = new System.Windows.Forms.Button();
this.btnInput = new System.Windows.Forms.Button();
this.btnUpdate = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// Gubun
//
this.Gubun.Text = "성별";
this.Gubun.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Gubun.Width = 100;
//
// JohapCd
//
this.JohapCd.Text = "성명";
this.JohapCd.Width = 80;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnSearch);
this.groupBox1.Controls.Add(this.txtSearchName);
this.groupBox1.Location = new System.Drawing.Point(8, 6);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(264, 52);
this.groupBox1.TabIndex = 38;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "사용자 검색창 : 성명";
//
// btnSearch
//
this.btnSearch.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
this.btnSearch.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.btnSearch.Location = new System.Drawing.Point(176, 16);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(72, 26);
this.btnSearch.TabIndex = 47;
this.btnSearch.Text = "검색";
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
//
// txtSearchName
//
this.txtSearchName.AutoSize = false;
this.txtSearchName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSearchName.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.txtSearchName.Location = new System.Drawing.Point(17, 16);
this.txtSearchName.Name = "txtSearchName";
this.txtSearchName.Size = new System.Drawing.Size(160, 26);
this.txtSearchName.TabIndex = 47;
this.txtSearchName.Text = "";
//
// label6
//
this.label6.BackColor = System.Drawing.Color.White;
this.label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label6.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label6.Location = new System.Drawing.Point(16, 130);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(550, 2);
this.label6.TabIndex = 34;
//
// txtAddr
//
this.txtAddr.AutoSize = false;
this.txtAddr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtAddr.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.txtAddr.Location = new System.Drawing.Point(103, 94);
this.txtAddr.Name = "txtAddr";
this.txtAddr.Size = new System.Drawing.Size(160, 26);
this.txtAddr.TabIndex = 33;
this.txtAddr.Text = "";
//
// JohapNm
//
this.JohapNm.Text = "주소";
this.JohapNm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.JohapNm.Width = 200;
//
// listView1
//
this.listView1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(225)));
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.JohapCd,
this.Gubun,
this.JohapNm,
this.Bigo});
this.listView1.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listView1.Location = new System.Drawing.Point(8, 144);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(568, 368);
this.listView1.TabIndex = 31;
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// Bigo
//
this.Bigo.Text = "전화번호";
this.Bigo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Bigo.Width = 175;
//
// txtName
//
this.txtName.AutoSize = false;
this.txtName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtName.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.txtName.Location = new System.Drawing.Point(103, 70);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(160, 26);
this.txtName.TabIndex = 29;
this.txtName.Text = "";
//
// label3
//
this.label3.BackColor = System.Drawing.SystemColors.Control;
this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label3.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label3.Location = new System.Drawing.Point(8, 94);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 26);
this.label3.TabIndex = 28;
this.label3.Text = "주소";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.BackColor = System.Drawing.SystemColors.Control;
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label2.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label2.Location = new System.Drawing.Point(8, 70);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(96, 26);
this.label2.TabIndex = 27;
this.label2.Text = "성명*";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.BackColor = System.Drawing.SystemColors.Control;
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label1.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label1.Location = new System.Drawing.Point(262, 70);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(96, 26);
this.label1.TabIndex = 32;
this.label1.Text = "성별*";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtTel
//
this.txtTel.AutoSize = false;
this.txtTel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtTel.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.txtTel.Location = new System.Drawing.Point(357, 94);
this.txtTel.Name = "txtTel";
this.txtTel.Size = new System.Drawing.Size(216, 26);
this.txtTel.TabIndex = 39;
this.txtTel.Text = "";
//
// label4
//
this.label4.BackColor = System.Drawing.SystemColors.Control;
this.label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label4.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label4.Location = new System.Drawing.Point(262, 94);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(96, 26);
this.label4.TabIndex = 40;
this.label4.Text = "전화번호*";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// comSex
//
this.comSex.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comSex.Font = new System.Drawing.Font("굴림", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.comSex.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.comSex.Location = new System.Drawing.Point(357, 72);
this.comSex.Name = "comSex";
this.comSex.Size = new System.Drawing.Size(216, 23);
this.comSex.TabIndex = 41;
//
// btnNew
//
this.btnNew.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
this.btnNew.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNew.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.btnNew.Location = new System.Drawing.Point(288, 24);
this.btnNew.Name = "btnNew";
this.btnNew.Size = new System.Drawing.Size(72, 26);
this.btnNew.TabIndex = 43;
this.btnNew.Text = "신규";
this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
//
// btnInput
//
this.btnInput.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
this.btnInput.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnInput.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInput.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.btnInput.Location = new System.Drawing.Point(359, 24);
this.btnInput.Name = "btnInput";
this.btnInput.Size = new System.Drawing.Size(72, 26);
this.btnInput.TabIndex = 44;
this.btnInput.Text = "입력";
this.btnInput.Click += new System.EventHandler(this.btnInput_Click);
//
// btnUpdate
//
this.btnUpdate.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
this.btnUpdate.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdate.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.btnUpdate.Location = new System.Drawing.Point(430, 24);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(72, 26);
this.btnUpdate.TabIndex = 45;
this.btnUpdate.Text = "수정";
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// btnDelete
//
this.btnDelete.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
this.btnDelete.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelete.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.btnDelete.Location = new System.Drawing.Point(501, 24);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(72, 26);
this.btnDelete.TabIndex = 46;
this.btnDelete.Text = "삭제";
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// AddrBook
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(252)), ((System.Byte)(242)), ((System.Byte)(255)));
this.ClientSize = new System.Drawing.Size(584, 516);
this.Controls.Add(this.btnDelete);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.btnInput);
this.Controls.Add(this.btnNew);
this.Controls.Add(this.comSex);
this.Controls.Add(this.txtTel);
this.Controls.Add(this.label4);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label6);
this.Controls.Add(this.txtAddr);
this.Controls.Add(this.listView1);
this.Controls.Add(this.txtName);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "AddrBook";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "주소록";
this.Load += new System.EventHandler(this.CDJohap_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion
static void Main()
{
Application.Run(new AddrBook());
}
private OleDbConnection LocalConn;
//**************************************************************
//
// ListView에 성명 데이터 전체를 로드하는 함수
//
//
//**************************************************************
private void DataLoad(OleDbDataReader myDataReader)
{
listView1.Items.Clear();
while(myDataReader.Read())
{
ListViewItem myitem1;
string gubun;
if (myDataReader["Sex"].ToString()=="M")
{
gubun = "남자";
}
else
{
gubun = "여자";
}

myitem1 = new ListViewItem(myDataReader["Name"].ToString());
myitem1.SubItems.Add(gubun);
//myitem1.SubItems.Add(myDataReader["Addr"].ToString());
//주소가 null 값을 리턴하면...
if(myDataReader.IsDBNull(2))
{
myitem1.SubItems.Add("");
}
else
{
myitem1.SubItems.Add(myDataReader["Addr"].ToString());
}
//Bigo 가 null 값을 리턴하면...
myitem1.SubItems.Add(myDataReader["Tel"].ToString());

listView1.Items.Add(myitem1);
}
myDataReader.Close();
}

//**************************************************************
//
// 주소록 폼이 로딩 될때 전체 데이터를 ListView에 로딩
// 콤보박스 초기화 작업
//
//**************************************************************
private void CDJohap_Load(object sender, System.EventArgs e)
{
try
{
//--------------------------------------------
LocalConn = Common_DB.DBConnection();
//--------------------------------------------
LocalConn.Open();
OleDbDataReader myReader = Common_DB.DataSelect("select * from AddrBook ",LocalConn);
DataLoad(myReader);

//Combo Box 채우기
comSex.Items.Add("남자");
comSex.Items.Add("여자");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "AddrBook Form Loading");
}
finally
{
LocalConn.Close();
}
}
//**************************************************************
//
// ListView에 마우스를 클릭 했을때 윗부분의 TextBox에 자료 로딩
// 2003.10.20
//
//**************************************************************
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e)
{
try
{
txtName.Text = listView1.SelectedItems[0].SubItems[0].Text;
comSex.Text = listView1.SelectedItems[0].SubItems[1].Text;
txtAddr.Text = listView1.SelectedItems[0].SubItems[2].Text;
txtTel.Text = listView1.SelectedItems[0].SubItems[3].Text;
}
catch(Exception)
{
//MessageBox.Show(ex.Message, "listView1_SelectedIndexChanged");
}
}
//**************************************************************
//
// 신규버튼 클릭시... TextBox부분을 Clear(새로운 데이터 입력을 위한)
//
//
//**************************************************************
private void btnNew_Click(object sender, System.EventArgs e)
{
txtName.Text="";
txtAddr.Text="";
comSex.Text="남자";
txtTel.Text="";
}
//**************************************************************
//
// 입력 버튼 클릭시 DB에 Insert 하는 부분
//
//
//**************************************************************
private void btnInput_Click(object sender, System.EventArgs e)
{
if(txtName.Text==""|| txtTel.Text==""||comSex.Text=="")
{
MessageBox.Show("성명, 성별, 전화번호는 필수 입력사항 입니다.");
txtName.Focus();
return;
}

string gubun;
if (comSex.Text=="남자")
{
gubun="M";
}
else
{
gubun="F";
}
LocalConn.Open();
string myExecuteQuery = "Insert Into AddrBook (Name, Sex, Addr, Tel) values(";
myExecuteQuery += "'" + txtName.Text+"'"+",";
myExecuteQuery += "'" + gubun+"'"+",";
myExecuteQuery += "'"+ txtAddr.Text + "'" + ",";
myExecuteQuery += "'"+ txtTel.Text + "'" + ")";

if (Common_DB.DataManupulation(myExecuteQuery, LocalConn))
{
OleDbDataReader myReader = Common_DB.DataSelect("select * from AddrBook",LocalConn);
DataLoad(myReader);
MessageBox.Show("정상적으로 입력 되었습니다...");
}
LocalConn.Close();
}
//**************************************************************
//
// 수정 버튼 클릭시 DB에 Update 하는 부분
//
//
//**************************************************************
private void btnUpdate_Click(object sender, System.EventArgs e)
{
if(txtName.Text==""|| txtTel.Text==""||comSex.Text=="")
{
MessageBox.Show("성명, 성별, 전화번호는 필수 입력사항 입니다.");
txtName.Focus();
return;
}

string gubun;
if (comSex.Text=="남자")
{
gubun="M";
}
else
{
gubun="F";
}
LocalConn.Open();
string myExecuteQuery = "Update AddrBook set Name='" + txtName.Text + "'" + ",";
myExecuteQuery += " Addr = '" + txtAddr.Text + "'" + ",";
myExecuteQuery += " Sex = '" + gubun + "'" + ",";
myExecuteQuery += " Tel = '" + txtTel.Text + "'" ;
myExecuteQuery += " where Name = " + "'" + txtName.Text + "'";

if (Common_DB.DataManupulation(myExecuteQuery, LocalConn))
{
OleDbDataReader myReader = Common_DB.DataSelect("select * from AddrBook",LocalConn);
DataLoad(myReader);
MessageBox.Show(" 정상적으로 수정 되었습니다...");
}
LocalConn.Close();
}
//**************************************************************
//
// 삭제 버튼클릭시 DB의 자료를 Delete
//
//
//**************************************************************
private void btnDelete_Click(object sender, System.EventArgs e)
{
OleDbDataReader myReader=null;
if(txtName.Text==""|| txtTel.Text==""||comSex.Text=="")
{
MessageBox.Show("성명, 성별, 전화번호는 필수 입력사항 입니다.");
txtName.Focus();
return;
}
//------- 삭제 확인
if (MessageBox.Show ("정말 삭제 하시겠습니까?", "삭제확인",
MessageBoxButtons.YesNo, MessageBoxIcon.Question)
!= DialogResult.Yes)
{
return;
}

LocalConn.Open();
string myExecuteQuery = "Delete AddrBook ";
myExecuteQuery += " where Name = " + "'" + txtName.Text + "'";

if (Common_DB.DataManupulation(myExecuteQuery, LocalConn))
{
myReader = Common_DB.DataSelect("select * from AddrBook",LocalConn);
DataLoad(myReader);
MessageBox.Show(" 정상적으로 삭제 되었습니다...");
}
LocalConn.Close();
}
//**************************************************************
//
// 검색 버튼클릭시 DB의 자료를 검색
//
//
//**************************************************************
private void btnSearch_Click(object sender, System.EventArgs e)
{
OleDbDataReader myReader=null;

LocalConn.Open();
myReader = Common_DB.DataSelect("select * from AddrBook where name like '%"+txtSearchName.Text +"%'",LocalConn);
if (myReader != null)
{
DataLoad(myReader);
myReader.Close();
}
LocalConn.Close();
}
}
}


-------------------------
2. CodeFile1.cs
-------------------------
using System;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlTypes;
using System.Windows.Forms;
public class Common_DB
{
//-----------------------------------------------------------------------------
// DataBase Connection
//-----------------------------------------------------------------------------
public static OleDbConnection DBConnection()
{
OleDbConnection Conn;
//아래는 오라클용 접속 문자열, data source 애는 tnsnames.ora 파일에 있는 Alias명을 넣으면 됩니다.
string ConStr = ("Provider=MSDAORA;data source=\\printserver;User ID=scott;Password=tiger");
Conn = new OleDbConnection(ConStr);
return Conn;
}
//-----------------------------------------------------------------------------
// DataSelect
//-----------------------------------------------------------------------------
public static OleDbDataReader DataSelect(string sql, OleDbConnection Conn)
{
try
{
OleDbCommand myCommand = new OleDbCommand(sql, Conn);
return myCommand.ExecuteReader();
}
catch(Exception ex)
{
//Log File에 출력
MessageBox.Show(sql + "\n" + ex.Message, "DataSelect");
return null;
}
finally
{
}
}
//-----------------------------------------------------------------------------
// DataDelete, DataInsert
//-----------------------------------------------------------------------------
public static bool DataManupulation(string sql, OleDbConnection Conn)
{
try
{
OleDbCommand myCommand = new OleDbCommand(sql, Conn);
myCommand.ExecuteNonQuery();
return true;
}
catch(Exception ex)
{
//Log File에 출력
MessageBox.Show(sql + "\n" + ex.Message, "DataManupulation");
return false;
}
finally
{

}
}
/*
*
* 실습용 Table script
create table AddrBook (
name varchar2(20) not null primary key,
sex varchar2(2) not null constraint ck_sex check (sex in ('M','F')),
addr varchar2(50),
tel varchar2(20) not null
)
*
* */
}



[오라클자바커뮤니티, 닷넷교육, ORACLEJAVANEW.KR]닷넷 어셈블리(.NET Assembly)

오늘은 3일차로서 닷넷 어셉블리의 1부를 학습 하도록 합니다. 조금 어렵게 느낄수 있는데 자바를 하신 분들은 자바 프로그램의 배포를 위한 Jar 파일 포맷을 아실 겁니다. 유사하게 생각 하시면 되구요 닷넷 환경의 프로그램이 배포되는 단위라고 정리하시면 됩니다.~
닷넷 어셈블리 (Assembly)란?

오라클자바커뮤니티에서 설립한 오엔제이프로그래밍 실무교육센터
(오라클SQL, 튜닝, 힌트,자바프레임워크, 안드로이드, 아이폰, 닷넷 실무전문 강의)  


닷넷에 대해 공부 하시다 보면 닷넷 어셈블리라는 말을 가끔식 보게 되실 겁니다. Low Level 언어인 Assembly는 절대 아니니 착오 없으시기를 바랍니다.어셈블리는 하나의 단일한 단위로 존재 하는 .NET 의 실행 가능한 프로그램 또는 실행 프로그램의 일부 입니다 . 결국 C# 프로그램의 실행 및 배포의 단위라고 할 수 있습니다 . C# 응용 프로그램 작성의 결과로 생긴 .exe 파일이 바로 하나의 어셈블리 이며 클래스 라이브러리 작성의 결과인 DLL(Dynamic Link Library) 도 하나의 어셈블리 입니다 . 하나의 단일한 어셈블리 안의 모든 코드는 하나의 단일한 단위로 빌드 , 배포되며 버전 번호가 부여되는데 각 어셈블리는 다른 프로그램들이 사용 할 수 있는 public class, 속성 , 메소드등을 노출하게 됩니다 . private 으로 선언된 것은 모두 어셈블리 안에 은폐 되는 것 입니다 .

다음은 구성요소 흔히 컴포넌트라고 하는것에 대해 잠시 정리하겠습니다.

MS 는 최초 DLL 을 도입하였는데 DLL 은 코드의 일부를 개별적인 파일로 분리 한 이며 프로그램이 같은 언어로 작성 되었을 때 기본적인 수준에서 동작하는 것 입니다 . 프로그램의 입장에서 자신이 사용하고자 하는 DLL 에 대해 많은 것을 알아야 하며 또한 프로그래머들이 서로의 데이터를 교환하는 용도로 DLL 을 사용 할 수 없습니다 .
데이터 교환의 문제를 해결 하기 위해 개발 된 것이 DDE(Dynamic Data exchange) 로 이것은 한 프로그램에서 다른 프로그램으로 데이터를 전송 하기 위한 형식과 메커니즘을 정의하는데 그리 유연하지는 않습니다 . 그 뒤로 OLE(Object Linkig and Embedding) 등장 하면서 Word 와 같은 문서가 다른 프로그램 (Excel) 을 자신안에 포함 할 수 있게 되었는데 비록 구성요소와 비슷한 개념을 지닌 기술이지만 OLE 1.0 을 진정한 범용적 구성요소로 보기는 어렵습니다 .
MS 최초의 진정한 구성요소의 표준은 1990 년대 중반에 나타난 COM(Component Object Model) 이라고 할 수 있습니다 . OLE 2.0 과 기타 여러 기술들은 COM 으로 통합 되었으며 COM 들이 네트웍 너머로 통신 할 수 있게 하는 DCOM, 다계층 환경에서 구성 요소 사이의 호출에 대해 높은 성능을 보장하는 서비스가 추가된 COM+ 가 등장 했습니다 .
COM 은 잘 동작하는 반면 배우기가 어렵고 사용하기도 어렵습니다 . COM 에서는 구성요소의 정보를 Windows Registry 에 등록해야 하는데 이는 구성요소의 설치와 삭제를 어렵게 하는 요인이 되었습니다 . COM 은 원래 C/C++ 를 위해 설계된 것이며 그 이후 VB 에서도 사용토록 개선 되었고 (“ 자동화 ” 라고 하는 것 ) 실제로 잘 동작 하고 있습니다 . 그 대신 C/C++ 로 VB 와 호환이 되는 구성요소를 만드는 것은 어려워 졌습니다 .( 예를 들어 다른 언어에서 정의된 클래스를 상속하는 것은 여전히 불가능 합니다 .)
또한 사용자가 MS 나 기타 회사들의 DLL 혹은 COM 구성 요소의 여러 버전을 설치하다 보면 문제가 발생 하는데 이는 버전이 다르더라도 DLL 파일의 이름은 동일 한데서 기인하는 것이 많습니다 . 그래서 이미 다른 프로그램에서 사용하는 DLL 을 덮어 씌워 버리는 경우가 자주 나타났으며 또한 시스템에 설치 된 DLL 정보를 관리하는 부담 때문에 구성요소의 업그레이드와 유지 보수가 갈수록 어려워 지는 것 입니다 . 결국 .NET 에서 이러한 문제들을 해결 할 수 있는 새로운 표준이 사용되는 것 입니다 .
다음은 닷넷어셈블리의 자기 서술적인 특징에 대해 알아 보겠습니다.
결국 어셈블리는 자바에서의 배포 단위인 Jar와 비숫하게 생각해 볼 수도 있습니다. Jar 파일에 Menifest 파일이 있어 그속에 JAr 파일의 구조에 대해 정의하고 있는데 이것을 자기 서술(Self Description) 이라고 합니다. 닷넷도 어셈블리 안에 자기서술적인 특징을 가지고 있습니다. 결국 기존의 DLL들 처럼 배포한 후 레지스터리에 등록하여 컴퓨터를 껐다 켜야 인식이 되는 것이 아니라 배포되는 닷넷 어셈블리안에 Self-Descriptiion을 하니까 그럴 필요가 없이 복사만 되면 발로 실행이 가능하다는것이 특징 입니다. 어셈블리에 어떤 것이 있는지가 .NET 어셈블리안에 있으므로 그것을 사용하는 프로그램이나 시스템은 레지스트리와 같은 외부 정보를 참조 할 필요가 없습니다 . 닷넷 어셈블리는 자신이 가지고 있는 개체와 메소드 뿐 아니라 매개변수의 데이터 형식까지 제공 합니다 . 또한 개체들의 버전 정보 , 보안정보도 제공하며 실제로 어셈블리의 설치는 기본적으로 대상 시스템에서 어센블리 파일을 복사하는 것으로도 충분 합니다 . 참고로 한가지 명심할 것은 네임스페이스와 어셈블리가 항상 일대일 대응을 이루는 것은 아니라는 것 입니다 . 예를들어 System.Data.dll 은 System.Data 와 System.Xml 네임스페이스의 일부를 구현하며 System.Xml 의 다른 루틴은 System.Xml.xll 에 구현되어 있습니다 .

다음은 교차 언어 프로그래밍에 대해 정리 하죠

구성요소는 어떠한 .NET 언어에서도 심지어 구성요소를 작성한 언어가 아닌 다른 언어에서도 호출 될 수 있습니다 . 이것 역시 어셈블리가 주는 장점 입니다 . 닷넷은 교차 언어적 프로그래밍을 가능하게 하는 아래와 같은 특징을 가지고 있습니다 .
• Cmmon language Runtime(CLR) : 모든 .NET 어셈블리의 실행을 관리
• Microsoft Intermediate Language(MSIL) : 모든 .NET 언어 컴파일러는 MSIL 을 생산 하며 이는 컴파일러가 생성하는 이진 코드의 표준으로 CLR 은 이 MSIL 코드에 기반하는 것입니다 . MSIL 은 또한 어셈블리의 메타 데이터를 저장 하는 형식을 정의 하는데 이는 어셈블리가 어떤 언어로 만들어 졌든 간에 공통의 형식으로 자신의 메타 데이터를 저장함을 의미 하는 것입니다 .
• Common Language Specification(CLS) : C#, VB, C++ 등 어떠한 닷넷 언어라도 CLS 를 만족 하기만 하면 언어의 경계를 넘어서 구성 요소들을 공유 할 수 있으며 언어의 경계를 넘어서 완전한 상속이 가능 합니다 .
• Common Type System(CTS) : 모든 .NET 언어들이 사용하는 기본 형식들과 자신의 클래스를 정의하는 규칙을 정의 한다 . 예를들면 어떤 언어가 문자열 형식을 비 호환적 방법으로 구현하는 일을 방지한다 . CLS 사양을 따르면 C# 으로 구성 요소를 작성 했을 때 그것을 담은 어셈블리는 VB.NET 같은 언어에서도 사용 될 수 있으며 마찬가지로 C# 은 VB.NET 이나 C++.NET 으로 작성된 구성요소를 사용 할 수 있습니다 . 또한 .NET Framework 에서는 이전에 만들어진 COM 에 대해서도 사용 할 수 있는 방법을 제공 하는데 이는 이전에 작성된 코드를 감싸는 인터페이스 역할을 하는 wrapper assembly 를 통해서 가능 합니다 . VS .NET 은 COM 구성요소에 대한 참조를 추가하면 자동적으로 래퍼 어셈블리를 만듭니다 .
오늘은 3일차로서 다분히 이론적인 내용 이었습니다. 다음 시간은 그림과 함께 닷넷 어셈블리에 대해 조금 더 깊이 살펴 보도록 하겠습니다.
수고하셨습니다.

Microsoft .NET Framework, C#, ASP.NET(C#교육, 닷넷교육, 자바교육, 오라클자바커뮤니티)

Microsoft .NET Framework, C#, ASP.NET

닷넷이란?
현재의 인터넷 환경을 혁신적으로 바꿀 차세대 MS의 제품군과 기술을 총칭하며
다음 세대의 플랫폼과 서비스를 위한 프레임웍이며 서비스로서의 소프트웨어의 Concret(공구리)

오라클자바커뮤니티에서 설립한 오엔제이프로그래밍 실무교육센터
(오라클SQL, 튜닝, 힌트,자바프레임워크, 안드로이드, 아이폰, 닷넷 실무전문 강의)  


It’s a vision
- A new platform for the digital era

It’s a brand
- One applied to many things

It’s a set of products and technologies
- A concrete set of software

인터넷을 통해서 자유롭게 프로그램을 배포하고 개발하려면 하나의 언어만(예를들면 C#)알고 있으면 되고, .NET framework 에 의해서 동일한 컴파일된 코드를 만들수 있다면 모든 프로그램을 .NET 으로 통합할 수 있고 서비스 할수 있다.
(자바 진영의 경우 자바언어 하나만 알고 있으면 웹프로그래밍, 응용 프로그래밍, 모바일 프로그래밍
등등등 모두 개발이 가능 한데 MS의 종래 Visual C, Visual Basic등은 그러질 못했었습니다.)
또한 아래 정도의 개념으로 보시는것은 좀더 구체적 일겁니다.

Microsoft's new Internet and Web strategy
NOT a new operating system
new Internet and Web based infrastructure
delivers software as Web Services
framework for universal services
is a server centric computing model
will run in any browser on any platform
is based on the newest Web standards


Visual Studio.NET은 C#,Visual Basic.NET,C++,J#,Jscript 등 여러 언어들을 지원 합니다.닷넷 환경에서 어느 프로그래밍 언어로 작성하든 컴파일된 코드(MSIL, Microsoft Intermediate Language)는 같다는 것이아주 강력한 특징 입니다. 즉 프로그래머가 가장 자신있고 편한 언어로 개발 하는 된다는 거죠... 그렇지만 대부분 C#을많이 사용하고 있죠... 뒤에서 하나씩 배우겠지만 C#을 평가하자면....
자바의 강력한 객체지향 특징과 파워풀함 + C++의 강력함 + VB처럼 쉬운 통합환경 의 3가지 요소가 결함된 최고라고할 수 있습니다. 열심히들 공부 하시기 바랍니다