.net软件工ç¨å¸ç¬è¯é¢ç®
1ï¼ è¯·ä¸ºASP.Netä¸ä¸ä¸ªå®ä¹ã
2ï¼ è¯·è§£éB/Sï¼å¹¶æ¯è¾C/Sï¼ç»åºB/Sçä¼ç¹ã
3ï¼ è¯·è¯´æ人们æåºâé¢å对象ç¼ç¨âæ¦å¿µçç¨ææ¯ä»ä¹ï¼
4ï¼ é
读以ä¸C++代ç ï¼å¹¶åçé®é¢ã
CPerson *aPerson = new CChinese();
aPerson->Say();
aPerson = new CAmerican();
aPerson->Say();
return 0;
ï¼1ï¼ ä¸è¿°ä»£ç çèåæ¯âç»æåç¼ç¨âãâé¢å对象ç¼ç¨âãâæ³åç¼ç¨âä¸çåªä¸ç§ï¼ä¸ºä»ä¹ï¼
ï¼2ï¼ ä¸ºä¸è¿°ä»£ç æé ä¸ä¸ªå½æ°ç¾åã
ï¼3ï¼ è¯´åºä¸è¿°ä»£ç åå¨çé®é¢ã
ï¼4ï¼ è¯·è¯´åºâCPersonâãâCChineseâãâCAmericanâä¸è
ä¹é´çå
³ç³»ã
ï¼5ï¼ è¯·è¯´æ第äºä¸ªâaPerson->Say( )â代ç è°ç¨çæ¯âCChineseâè¿æ¯âCAmericanâçâSayâå½æ°ï¼è¿ä½ç°äºä»ä¹ç¹å¾ï¼
5ï¼ è¯·è¯´åºä¸ç§ç¨åºçåºæ¬ç»æã
6ï¼ è¯·è¯´æä»ä¹æ¯â客æ·ç¨åºâã
7ï¼ è¯·æåºä»¥ä¸åªå 个åéååå¾æ¯è¾å¥½ï¼
ï¼1ï¼abc ï¼2ï¼m_Name ï¼3ï¼aCat ï¼4ï¼curTime ï¼5ï¼currentTime
ï¼6ï¼seekCount4Person ï¼7ï¼sc_Person ï¼8ï¼found ï¼9ï¼fnd
ï¼10ï¼iCount ï¼11ï¼count
8ï¼ è¯·è¯´æâå
³ç³»è¡¨è¾¾å¼åé»è¾è¡¨è¾¾å¼âä¸âå½é¢é»è¾åè°è¯é»è¾âä¹é´çå
³ç³»ã
9ï¼ è¯·è¯´åºC++ä¸ç¬ç«å½æ°çææå
ç´ ã
10ï¼ è¯·è§£éâæ¥å£âçæ¦å¿µã
11ï¼ é
读以ä¸C++代ç ï¼å¹¶åçé®é¢ã
int add( int x = 0, int y = 0 )
{ return x + y;}
float add( float x = .0f, float y = .0f )
{ return x + y;}
double add( double x, double y )
{ return x + y;}
void main(void){
cout << add( 1, 2 ) << endl;
cout << add( 3.5, 4.7 ) << endl;
cout << add( ) << endl; }
ï¼1ï¼ ä¸è¿°ä»£ç 使ç¨å°çæ¯âOverloadâææ¯è¿æ¯âOverrideâææ¯ï¼
ï¼2ï¼ å¨C++ä¸å¯ä»¥éç¨ä»ä¹ææ¯ç®åä¸è¿°ä»£ç ï¼è¯·å®ç°ä¹ã
ï¼3ï¼ è¯´åºä¸è¿°ä»£ç åå¨çé®é¢ã
12ï¼ è¯·è¯´åºC++ä¸âæååéçç§æâãâå®ä¹ç±»çæåâãâæ个类æ¯å¦å¤ä¸ä¸ªç±»çåç±»âãâOverrideåvirtualæåå½æ°âåç§ä»£ç 表ç°åå«ä½ç°äºé¢å对象çå大åºæ¬ç¹å¾çåªä¸ä¸ªï¼
13ï¼ è¯·è¯´åºC++ä¸âç±»çç»åâãâæåå½æ°çåæ°ä¸ºæ个类ç对象âãâæ个类æ¯å¦å¤ä¸ä¸ªç±»çåç±»âãâ纯èæåå½æ°âåç§ä»£ç 表ç°åå«ä½ç°äºé¢å对象çåç§åºæ¬å
³ç³»çåªä¸ç§ï¼
14ï¼ è¯·è¯´åºä¸ºä»ä¹å¨C++ä¸ææå½æ°æ好å®ä¹ä¸ºèå½æ°ï¼
15ï¼ è¯·è¯´æC++ä¸ï¼ææ ·è®©ä¸ä¸ªå®¢æ·ç¨åºæ æ³å®ä¾åæ个类ç对象ã
16ï¼ è¯·è¯´æC++ä¸ï¼ææ ·è®©æ´ä¸ªç¨åºåªè½å®ä¾åä¸æ¬¡æ个类ç对象ã
17ï¼ è¯·ç以ä¸çUMLå¾ï¼ç¼åâCAnimalâãâCDogâãâCEyeâä¸ä¸ªç±»çC++声æ代ç ã
18ï¼ é
读以ä¸C++代ç ï¼å¹¶åçé®é¢ã
class CString {
public:
int Compare(const char* s);
CString(CString& s);
int Compare(CString& s);
CString& Add(CString& s);
int GetLength();
const char* C_Str();
CString(char c, unsigned int n = 1);
CString(const char* s);
CString();
virtual ~CString();
protected:
int CalLength(const char* s);
void Clear();
void Init();
private:
unsigned int m_length;
char* m_str;
};
ï¼1ï¼ è¯·è¯´æ该类æå 个æé å½æ°ï¼
ï¼2ï¼ âconst char* C_Str()â为ä»ä¹è¦å ä¸constå
³é®åï¼
ï¼3ï¼ å¦æâCString s = otherString;âä¼ä¸ä¼è°ç¨æé å½æ°ï¼å¦æè°ç¨å°ä¼è°ç¨åªä¸ªæé å½æ°ï¼
ï¼4ï¼ è¯·å®ç°âGetLengthâæåå½æ°ã
ï¼5ï¼ è¯·å®ç°âCString(char c, unsigned int n = 1);âæé å½æ°ã
ï¼6ï¼ è¯·å®ç°âCompare(const char*s);âæåå½æ°ã
ï¼7ï¼ è¯·å®ç°âClear();âæåå½æ°ã
ï¼8ï¼ å¦æå¢å âInputStringâæåå½æ°ç¨äºä»é®çè¾å
¥å符串ï¼è¯·é®æ¯å¦åéï¼ä¸ºä»ä¹ï¼
ï¼9ï¼ è¯·é®ä»£ç âCompare(CString& s){ return Compare(s.C_Str());}âæ¯å¦å¯è¡ï¼å¦æå¯è¡ï¼æä»ä¹å¥½å¤ï¼
19ï¼ è¯·è¯´ææ°æ®åºä¸Viewæ¯âå¤æ¨¡å¼âãâ模å¼âè¿æ¯âå
模å¼âï¼
20ï¼ è¯·çä¸å±å
¬å¼è¯´æçæ¯ä»ä¹è¿æ¥è¿ç®ï¼
21ï¼ é
读以ä¸æ°æ®åºæ¨¡å¼ï¼å¹¶åçé®é¢ã
Course( CourseID#, Name, CheckType, Property )
Student( StudentID#, Name, ClassID )
Class( ClassID#, Name, SpecialityID, DepartmentName )
Speciality(SpecialityID#, Name, DepartmentID )
Department(DepartmentID#, Name, Address )
ChooseCourse(StudentID#, ClassID#, CourseID#, Term#, Score1, Score2)
注æï¼ä¸è¿°â#â表示主ç ã
ï¼1ï¼ åSQLï¼æ±æ¯é¨è¯¾ç¨ç修读人æ°ï¼ç»æä¸å
å«è¯¾ç¨å称ï¼ã
ï¼2ï¼ åSQLï¼æ±ä¿®è¯»äººæ°å¤§äº30人ç课ç¨ï¼ç»æä¸å
å«è¯¾ç¨å称ï¼ã
ï¼3ï¼ åSQLï¼æ±ä¿®è¯»è¯¾ç¨æ°å¤äº1é¨çå¦çï¼ç»æä¸å
å«å¦çå§åï¼ã
ï¼4ï¼ åSQLï¼æ±â信管04-1çâæ¯ä½åå¦éä¿®çå¦åæ»æ°ï¼ç»æä¸å
å«å¦çå§åï¼ã
ï¼5ï¼ åSQLï¼æ±æ¯ä¸ªå¦é¢ï¼é¨é¨ï¼çå¦çäººæ° ã
ï¼6ï¼ è¯·è¯´åºä¸è¿°æ°æ®åºæ¨¡å¼æ¯å¦ç¬¦å第åèå¼ï¼å¦æä¸ç¬¦åï¼è¯·å°å
¶è¿è¡è§èåå¤çã
ï¼7ï¼ è¯·è¯´åºä¸ºä»ä¹éè¦è§èåå¤çï¼
ï¼8ï¼ è¯·ä¸ºä¸è¿°è§èåå°ç¬¬åèå¼çæ°æ®åºç»å¶åºæ¦å¿µæ¨¡åï¼ERå¾ï¼ã
22ï¼ è¯·å®æä¸è¡¨çå¡«åã
é离级å«
è读
ä¸å¯éå¤è¯»å
å¹»å
READ UNCOMMITTED
READ COMMITTED(é»è®¤)
å¦
REPEATABLE READ
æ¯
SERIALIZABLE
å¦
注æï¼âæ¯â表示æé离级å«ä¼åºç°æç§é误çæ
åµï¼âå¦âååä¹ã
23ï¼ è¯·æç
§ä¸å¾è§£éâä¸å±ç³»ç»æ¶æâã
Presentation
Business
Data
DB
ç½é¡µ
24ï¼ è¯·å®æ以ä¸ç¿»è¯ï¼å¯ä»¥ç²¾ç®æå
容æè¦ï¼ã
Passage One:
The .NET Framework provides a first-class foundation for building and consuming Web services based off of the fundamental protocols of XML, SOAP, and WSDL. But despite the interoperable and loosely coupled beauty of these traditional Web services, before long one finds one's self wanting for more. For instance, in the area of security, it seems contradictory to depend on HTTP security mechanisms when SOAP messages were designed to hold metadata-like security information. Similarly, the request/response nature of HTTP, which fits perfectly for many message exchange patterns, seems like an overly restrictive one-size-fits-all solution when other message exchange patterns would fit your business needs better. This is a particularly frustrating restriction because the SOAP specification goes out of its way to avoid such limitations in Web service message exchange.
Web Services Enhancements (WSE) is the Microsoft extension to the Web service support in the .NET Framework that builds on the foundation of XML, SOAP, and WSDL with higher-level protocols that support such things as message-based security, policy-based administration, and the flexibility to move message-exchange out of the HTTP-only world. The result is a Web service platform that can save developers from the tedious, time-consuming, and fragile world of developing higher-level requirements themselves. Instead they can rely on the supported and interoperable solution that is provided by WSE.
Passage Two:
The BaseDataBoundControl is the root of all data-bound control classes. It defines the DataSource and DataSourceID properties and validates their assigned content. DataSource accepts enumerable objects obtained and assigned the ASP.NET 1.x way.
Mycontrol1.DataSource = dataSet;
Mycontrol1.DataBind();
DataSourceID is a string and refers to the ID of a bound data source component. Once a control is bound to a data source, any further interaction between the two (in both reading and writing) is handled out of your control and hidden from view. This is both good and bad news at the same time. It is good (rather, great) news because you can eliminate a large quantity of code. The ASP.NET framework guarantees that correct code executes and is written according to recognized best practices. You're more productive because you author pages faster with the inherent certainty of having no subtle bugs in the middle. If you don't like this situationâlook, the same situation that many ASP.NET 1.x developers complained aboutâyou can stick to the old-style programming that passes through the DataSource property and DataBind method. Also in this case, the base class saves you from common practices even though the saving on the code is less remarkable.
温馨提示:内容为网友见解,仅供参考