.NET Naming Rule - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

.NET Naming Rule

Description:

.NET Naming Rule Guide Line. (Constants) 1. . Upper Case. , _ . ex) int. MAX_COUNT = 1000; – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 19
Provided by: tist264
Category:
Tags: net | naming | role | rule

less

Transcript and Presenter's Notes

Title: .NET Naming Rule


1
.NET Naming Rule 2009.10.07
2
.NET Naming Rule Guide Line
  • ?? ??

?? ?? ?, ? ?? ??? ?? ???? ?? ??? ?????? ??? ????
???? ????? ??? ?? ?? ? ???? ?? ? ????.
  • ?? ?? ??? ?? ?? ??? ??
  • - ??? ??? ???? ???? ??? ?? ??? ??? ?? ?? ??
  • - ?? ??? ??? ??? ??? ??
  • - ??? ?? ??? ??? ??? ??? ? ?? ??? ??
  • ?? ?? ?? ? ?? ??
  • - ??(???? ??)? ?? ?? ??? ??? ????. (?? ???, ???
    ?? ??)
  • - ??? ???? ??? ?? ????? ??? ?? ???? ????.
  • - ?? ??? ???? ??? ??? ?? ? ????.
  • - ?? ??? ??? ???? ??? ???? ?? ?? ????, ????? ??
    ??? ?? ????.
  • - ?? ? ??? ????. (15? ?? ??)

3
.NET Naming Rule Guide Line
  • ?? ?? ???

? ? ? ? ? ? ? ? ? ?
Pascal Case ?? ??? ? ?? ??? ???? ??. ProductCatalog ??? ???(Enum), ??? ??? ?? ?? ?? ?? ????? ??? ??????, ?? ?
Camel Case ? ? ?? ??? ????, ??? ? ??? ? ?? ??? ???? ??. productCatalog ????(parameter) ???? ??, ??? ??
Upper Case ?? ??? ???? ??. System.IO 2?? ??? ??, ??
Hungarian Case Pascal Case ?? ?? ??? ?? ??? ????. dtDocData ??? ?? ??? ?? ??
4
.NET Naming Rule Guide Line
  • ???(Class)
  • ??? ?? ?????? ??? ??? ????.
  • ?? ??(??, ???)? ???? ?? ???? ??, ?? ?? ??? ???? ?
    ???
  • ?? ??(MemberList)? ??? ????.
  • ??? ??? ????? ??? ??? ????, ???? Pascal Case?
    ????.

? ? ?? ?? ? ?
Base Class ?? ?? ? Base RuleBase, DacBase
Business Façade Use Case Group ? System/Façade/Service ProductSystem, OderService
Business Rule Use Case Group ? Biz MemberBiz
Data Access Component Use Case Group ? Dac ??? ? Dac MemberDac
Exception Class ??? ?? ?? ? Exception BusinessRuleException
5
.NET Naming Rule Guide Line
  • ??? ???(Base Class)
  1. ????? ???? ?? ???? ????, ?????? ????? ?? ??? ?
    Role?? ? ??? ??? ?? ??? ?????.
  2. ??? Role? ???? Class? ???? ???? ???? ??? ????
    Base Class??? ?? ??? ????? ??.
  3. ??? ???? ? Layer?? ??? Utility API? ?????, ???? ?
    Logging ?? ??? ????? ????.

? ? ?? ?? Transaction Option
Web Service WebServiceBase
Business Rule Use Case Group ? BizBase ???? ?? ? ??? ? _Tx (??? ??? ??)
Data Access Component Use Case Group ? DacBase
6
.NET Naming Rule Guide Line
  • ?????(Interface)
  • ??? ?? ??? ????, ??? I? ???? ???? ??????? ??? ?
    ??? ??.
  • ex) IServiceProvider, Icomponent
  • ???
  • ?? / ???(?? ??)? ???? ???? Pascal Case? ????,
    ????? ????? Camel ???? ???? ??? ???? ??? ??? ? ??
    ??? ?????? ??.
  • ex) GetUsers(), RegisterUser(string userId)
  • Business Rule, Data Access ??? ??? ???? ??? ???
    ??? ????.

?? Business Façade / Rule Data Access Componenet
?? Add / AddNew / Append / Register ?? ex) AddNewMemberInfo Insert
?? Modify / Change / Update ?? ex) UpdateMemberInfo Update
?? Remove / Delete ?? ex) DeleteMemberInfo Delete
?? Get / Inquire ?? / Inquire ?? By ??(Optional) ex) GetMemberInfo, GetMemberInfoByMemberID Select / Inquire / ???? Scalar ??? Boolean? ??? ??? ??? ???? ??? ???? ????? ???. ex) MaxNumber(), IsExist(string userId)
7
.NET Naming Rule Guide Line
  • ??(Variant) ? ??(Field)
  • ?? ??? ????? ??? ?? ??? ????.
  • ????? Camel Case? ????.
  • ex) empName, result, name
  • ??? ?? ??(??? ? ??)? UI ???? ??(?? ??)? ??? ????
    ???? ?? ????.
  • (Hungarian Case ???)
  • ex) dtResult, drSelectedRow, ibtnSearch(Image
    Button), btnSelect
  • ?? ??, ?? ??, ???? ??? Camel Case? ????, ?? ???
    Pascal Case? ????.
  • ?? ??? ?? ??? ????? Camel Case ???? ????, ?? ???
    ?? ??? ??? ?? ?? this ? ????.
  • ex)
  • private string memberName
  • public void SomeMethod(string memberName)
  • this.memberName memberName

?? ?? ???
DataSet ds
DataRow dr
DataColumn dc
DataTable dt
DataView dv
TableCell tc
??? ?? ?? ???
8
.NET Naming Rule Guide Line
  • ??(Constants)

1. ???? Upper Case? ????, ??? ?? ??? _?
????. ex) int MAX_COUNT 1000
  • ??(Property)
  • Pascal Case ???? ????.
  • ?? type(private)? ??? ??? ????.
  • Private ???? ??? ??? ?? ?, Pascal Case ???? ????.
  • ex)
  • // ?? type? ??, Camel Case ??
  • private int itemCount
  • // Private ???? ??? ??? ????? ?? ??, Pascal
    Case ??
  • public int ItemCount
  • get
  • set

9
.NET Naming Rule Guide Line
  • ???(Event)
  • ???? Pascal Case? ????, ??? ???? ????
    EventHandler ???? ????.
  • ex) MouseEventHandler
  • ??? ?? ??? ???? EventArgs ???? ????.
  • ex) MouseEventArgs
  • public delegate void MouseEventHandler(objec
    t sender, MouseEventArgs e)
  • ??? ???? ??, BeforeXXX / AfterXXX ?? ing / (e)d
    ??? ????.
  • ex) BeforeClose, AfterClose ? Closing, Closed

10
.NET Naming Rule Guide Line
  • ??????(Namespace)
  • Pascal Case ? ????. (?? ??)
  • ???.???/??.??????/????.?????.?????
  • ex) Microsoft.Windows.WindowsServer.IIS
  • ?? ???? ?? ???/??, ?? ???, ??? ?? ?? ??
    ????.
  • ex) NEO.Development.MessengerApp

?? ? ? ?? ?? ?? ??
1 ??? Neoplus (?? ??? ?? Upper Case ??? NEO) X
2 ??? / ?? Development O
3 ?????? / ???? MessengerApp X
4 ?? ??? InstantChatting O
5 ??? ?? Biz O
11
.NET Naming Rule Guide Line
  • ??????(Namespace)
  • Server Component Layer? ?? ??? ?? Layer ?? ??????
    ?? ????.
  • ex) NEO.Development.MessengerApp.Web

Layer Namespace
Biz Layer Biz
Dac Layer Dac
Web UI Web
Web User Control WebCtl
Web Service WS
Windows Form Win
Windows Console Con
Windows Service WinSvc
12
.NET Naming Rule Guide Line
  • ??

1. ?? ???? ?? ???(1)
??? ?? ??? ?? ??? ?? ??? ??
Adrotator rot rotMenu MainMenu mnu mnuOption
Button btn btnOK MonthCalendar cal calThisMonth
ComboBox cbo cboCountry PictureBox pic picPhoto
CheckBox chk chkSubject Panel pnl pnlCategory
CheckBoxList chkl chklJuso ProgressBar prg prgStatus
CompareValidator vcomp vompCom RichTextBox rtf rtfNotepad
CustomValidator vcst vcstCheck RadioButton rad radEducation
CrystalReportViewer crv crvReport RadioButtonList rbtnl rbtnlHobby
DataGrid dgr dgrCustomer Repeater rep repBook
DropDownList ddl ddlName RequiredField Validator vreq vreqCheck
DataList dlst dlstAdress RangeValidator vrng vrngScop
DateTimePicker dtp dtFromDate RegularExpression Validator vrex vrexCheck
Dialogs dlg dlgFileOpen StatusBar stb stbCurrent
Form frm frmPath TextBox txt txtAddress
GroupBox grp grpBox TreeView tvw tvwOrgan
HyperLink hlnk hlnkHome TabControl tab tabBasicInfo
13
.NET Naming Rule Guide Line
  • ??

1. ?? ???? ?? ???(2)
??? ?? ??? ?? ??? ?? ??? ??
ImageButton ibtn ibtnOK Timer tmr tmrEvent
Image img imgBack ToolBar tlb tlbMenu
ListBox lst lstAddress ValidationSummary vsumn vsumnOK
Label lbl lblName XML xml xmlData
LinkLabel hlbl hlblTitle
Listview lvw lvwService










14
.NET Naming Rule Guide Line
  • ??

2. HTML ???? ?? ???
??? ?? ??? ??
Button hbtn hbtnGo
CheckBox hchk hchkHobby
DropDown hddl hddlJuso
File Field hfile hfilePage
Image himg himgBack
Label hlbl hlblName
ListBox hlst hlstCity
ResetButton htbtn htbtnCancel
RadioButton hrbtn hrbtnJob
SubmitButton hsbtn hsbtnOK
TextField htxt htxtName
HiddenField hhd hhdName
Table htab htabItemList
TableRow htabr htabrTempRow
TableCell htabc htabcTempCell
Anchor hac hacRedirect
Span hspn hspnLable
Div hdiv hdivTable
15
.NET Naming Rule Guide Line
  • ??

3. ?? ???? ?? ???(1)
??? ?? ??? ?? ??? ?? ??? ??
Button btn btnRegister NumricUpDown nud nudPrice
CheckedListBox clb clbYN NotifyIcon nic nicProduct
CheckBox chk chkYN OpenFileDialog ofd ofdExcel
ComboBox cbo cboProduct PictureBox img imgProduct
ContextMenu cmn cmnFile Panel pnl pnlJob
ColorDialog col colBackColor ProgressBar prg prgStatus
ComponentOne FlexGrid cdg cdgCustomerInfo RichTextBox rtb rtbThinkPad
DataGrid dgr dgrProduct RadioButton rad radJob
DateTimePicker dtp dtpFromDate SaveFileDialog sfd sfdFile
DomainUpDown dud dudProduct StatusBar stb stbUserInfo
ErrorProvider err errDatabase Splitter spl splMenu
FontDialog fnt fntMain Timer tmr tmrAsync
GroupBox grp grpJob TextBox txt txtUserId
Hor.Scrollbar hsb hsbLimit TrackBar trb trbUser
HelpProvider hlp hlpMenual ToolTip tip tipTimer
ImageList iml imlProduct ToolBar tbr tbrMenu
16
.NET Naming Rule Guide Line
  • ??

3. ?? ???? ?? ???(2)
??? ?? ??? ?? ??? ?? ??? ??
Label lbl lblName TreeView tvw tvwMenu
ListView lvw lvwProduct TabControl tab tabUserInfo
LinkLabel llb llbTitle TabPage tbp tbpJob
ListBox lst lstProduct Vert.Scrollbar vsb vsbLimit
Menu mnu mnuFile
MonthCalendar cal calExport










17
.NET Naming Rule Guide Line
  • ??

4. ?? ?? ?? (1)
using System using System.Collections.Generic using System.ComponentModel using System.Configuration using System.Data using System.Drawing using System.Linq using System.Text using System.Windows.Forms using Microsoft.SharePoint //. ?????? ???.????.????? ??? ??, Pascal Case ??? namespace Neoplus.MonitoringApp.Win public partial class DocumentList Form //. ?? Upper Case ??? private const string SITE_URL ConfigurationManager.AppSettings.Get("SiteUrl") as string private const string LIST_NAME ConfigurationManager.AppSettings.Get("ListName") as string public DocumentList() InitializeComponent()
18
.NET Naming Rule Guide Line
  • ??

4. ?? ?? ?? (2)
private void btnRefresh_Click(object sender, EventArgs e) this.dgvDocument.DataSource GetDocList(LIST_NAME) //. ???? Pascal Case ??? ???? Camel Case ??? private DataTable GetDocList(string listName) //. ??? ?? ?? ? UI ??? Hungarian Case ??? DataTable dtDoc new DataTable() SPSecurity.RunWithElevatedPrivileges(delegate() //. ?? Camel Case ??? using (SPSite site new SPSite(SITE_URL)) using (SPWeb web site.OpenWeb()) SPList list web.ListslistName dtDoc list.Items.GetDataTable() ) return dtDoc
Write a Comment
User Comments (0)
About PowerShow.com