390 likes | 555 Views
표지. Analysis & Design of Information Systems Development of the Messenger System. Ta Suong Phung, Lee SunHwa, Kim ChangBong. Review:6 날짜 : 2008.06.10. Contents of the Term Project. Project Management Conference Records Schedule The Thesis Select Target System Basic Function
E N D
표지 Analysis & Design of Information Systems Development of the Messenger System Ta Suong Phung, Lee SunHwa, Kim ChangBong Review:6 날짜: 2008.06.10
Contents of the Term Project • Project Management • Conference Records • Schedule • The Thesis • Select Target System • Basic Function • Organization • Analysis of the System • System Running Process • System Module • Selection of the Compiler • Design of the System • System Modeling • GUI Design • D/B Design • Implementation of the System • GUI Development • Module • Messenger S/W • 6. System Open • List of the Problems • Make up for the Weak Points • 7. Event • 5/13(Problem Statement) • 5/27(Analysis & Design) • 6/10(System Open)
1. Project Management-Schedule 2008 Detail Work MAY JUNE 05/08 ▼ Function & Process Define Pre_Process (05/13) First P resentation ▼ Analysis (05/20) ▼ Modeling Main_Process (05/27) Second P resentation ▼ Implementation (06/10) Final Presentation ▼ System Open Post_Process
1. Project Management-Reference Book & Source • Reference Book • UML 활용 • Teach yourself C, C++, Visual C++ 6.0 • Step by Step Visual C++ • Visual C++ .NET 프로그래밍 정복 • Visual C++ 6.0 그대로 활용하기 • Visual C++ Programming Bible • Visual C++ .NET Programming Bible • 메시지를 중심으로 한 Visual C++ .NET • 이형배의 Visual C++ 6.0 • Windows API 정복 • Visual C++ How To • Reference Site • http://www.codeguru.com • http://www.devpia.com
2. The Thesis-Select Target System • Some Alternative System for Term Project • Person To Person FTP (File transfer protocol) • Messenger: for chatting and transferring file • Calculator • Explorer • Database programming for Our Class: input, output, modify, delete & relation • We choose the target system: • Messenger => It’s very useful and interesting for all people day by day
2. The Thesis-Basic Function • Basic Function of Messenger Programming • Chatting: group chat or single chat • Send & Receive file • Show Webcam • Voice chat • Connect to blog, mail... • For limited time, we just focus on 2 main basic function • Chatting: single chat • Send & Receive file
3. Analysis of the System-Running Process • Run Messenger Program • Register Friend list: ID, IP, description • Double Click on the Friend Name • New window appear • Connect to the friend • Chatting • Transfer file (if needed) • Close the window (end of chatting)
3. Analysis of the System-System Module • For a messenger programming, we need some system module: • Manager List • State check • Chatting Module • Transfer Module • Open • Select file • Sender • Check result
3. Analysis of the System-Selection of the Compiler • We have developed our Team Project Program using C++ with .Net • There are some reason as follows • Team Member have not experience with JAVA • We have message source that developed C++ • C++ provide with excellent function for CLASS Definition • Member Function and Member Variables • OOP (Object Orient Programming) • Visual GUI • Class Management with Tree Structure
4. Design of the System –System Modeling(Object) • Identify Object:
4. Design of the System –System Modeling(Object) • Data dictionary: • User: the person directly using the messenger programming • IP: the IP address for connecting to Internet • ID: the user name in the messenger program • Friend List: the list of friend for each ID user name • File transfer: the file needed to transfer between the user and friend • Path: the address of the file • Messenger Management: control the messenger list (delete or add friend) • Chatting conversation: the content of chatting • Chatting sentence: sentence in the content of chatting • Word: each chatting sentence composes of many words
4. Design of the System –System Modeling(Object) • Identify Association
4. Design of the System –System Modeling(Object) • Attribute of object
4. Design of the System –System Modeling(Dynamic) • Event Classes and Attributes • Running Program (File) • Show Tray Menu (IP, ID, User) • Show Main Menu (Pop-Up Menu) • Send Instant Message (Chatting Window) • Deleting List (IP, ID, User) • New Friend (IP, ID, User) • File Trans (Path, File Transfer) • Checking Online (IP) • Chatting (Keyboard, Chatting Sentence, Word)
4. Design of the System –System Modeling(Dynamic) User Messenger Friend Double click Messenger File Check Status Return Status Result • Event • Trace Show Program Right Click on “Name” Show Main GUI Select “Send Message” Show Friend Status Key in Send Message Key In Select “File Trans” Show Message O.K? Show Message Select File Send File Select “Cancel” EndProgram
4. Design of the System –System Modeling(Dynamic) Idle Register tray Double click • State diagram • Review 1 Double click Minimum P/G Running P/G do: Show Friend List Double click on “Name” Click “CANCEL” Checking Online State Closing Window Waiting Mode Waiting Mode Double click State On State Off Chatting Window Failure Connection do: Show Message Click “CANCEL” Connection Disconnection Connected do: Chatting File Search do: Show Directory Acceptable Checking Select File Click “TRANS” Accept Key In success do: O.K Message Closing Window Click “O.K” Not Accept Not success do: Failure Message Click “O.K”
4. Design of the System –System Modeling(Dynamic) Idle (ICON) Register tray Closing P/G Program Double click P/G Stop Right Click Tray Icon Select Exit • State diagram • Review 2 Left Click Show Tray Menu Show Messenger Select Show Waiting Mode Waiting Mode Running P/G do: Show Friend List Right Click on “Name” Click “CANCEL” Show Main Menu Closing Window Delete Friend New Friend File Send Send Message State Off Deleting List Friend Window File Search do: Show Directory Checking Online State Failure Connection do: Show Message Clink “O.K” Select File State On Connection Add Friend Acceptable Checking Chatting Window Connected do: Chatting Accept Click “CANCEL” Not Accept Key In File Sending Process do: Not Accept Message Closing Chat Window Click “O.K” do: O.K Message
4. Design of the System –System Modeling(Dynamic) Idle (ICON) Register tray Closing P/G Program Double click P/G Stop Right Click Tray Icon Select Exit • State diagram • Review 3 Left Click Show Tray Menu Show Messenger Select Show Waiting Mode Running P/G do: Show Friend List Right Click on “Name” Click “CANCEL” Show Main Menu (Multi Thread) Closing Window Delete Friend New Friend File Trans Send Message State Off Deleting List Friend Window File Search do: Show Directory Checking Online State Failure Connection do: Show Message Clink “O.K” Select File State On Input Data Connection New Friend Acceptable Checking Chatting Window Connected do: Chatting Add Friend Accept Click “CANCEL” Not Accept Key In File Sending Process do: Not Accept Message Closing Chat Window do: O.K Message
4. Design of the System –System Modeling(Dynamic) Idle (ICON) Register tray Closing P/G Program Double click Right Click Tray Icon Select Exit Left Click “Show Messenger” • State diagram • Review 4 P/G Stop Show Tray Menu Show Messenger Select Show Checking Online State Running P/G do: Show Friend List Right Click on “Name” Click “CANCEL” Show Main Menu (Multi Thread) Closing Window Delete Friend New Friend File Trans Send Message State Off Chatting Window Deleting List Friend Window File Search do: Show Directory Failure Connection do: Show Message Clink “O.K” Select File State On Input Data Connection New Friend Acceptable Checking Chatting Window Connected do: Chatting Add Friend Accept Click “CANCEL” Not Accept Key In File Sending Process do: Not Accept Message Closing Chat Window do: O.K Message
4. Design of the System –Functional Modeling • Data Flow diagram
4. Design of the System –GUI Design Review1 Messenger Right Click! 1 2 3 File Selection Show Directory Minimize Chatting 4 OK Chatting Result File Accepted Accept Not Input Text CANCEL
4. Design of the System –GUI Design Review2 Messenger Right Click! 1 2 3 File Selection Show Directory Minimize OK 4 Chatting On-line status for Friend Chatting Result File Accepted Accept Not Input Text CANCEL
4. Design of the System –D/B Design File Name: FriendList.txt Ta Suong Phung; 192.163.125.12; Friend Lee SunHwa; 192.163.125.12; Friend Kim ChangBong; 192.163.125.12; Friend . . . . . . Messenger Minimize When Program Running, The Program read Friend list from text file that named “FriendList.txt” The Character‘;’means that divide symbol for each text
5. Implementation of the System–GUI Development Main Messenger GUI Main Chatting GUI File Trans Status GUI Register Friend GUI
5. Implementation of the System–Module 24 Class Type are implemented Program Source (head & cpp)
5. Implementation of the System–Module • Manager List ///////////////////////////////////////////////////////////////////////////// // CNewFriend dialog class CNewFriend : public CDialog { // Construction public: CNewFriend(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CNewFriend) enum { IDD = IDD_DIALOG_NEWFRIEND }; CString m_strId; CString m_strIntroduce; CString m_strIp; CString m_strName; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CNewFriend) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CNewFriend) virtual void OnOK(); virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedOk(); }; Class Definition • Class Name: CNewFriend • Member Function • OnInitDialog • On Ok • Member Variables • m_strId • m_strIntroduce • m_strIp • m_strName
5. Implementation of the System–Module • Manager List Functon Definition Class link with GUI • if(File.Open("FriendList\\FriendList.txt",CFile::modeCreate | CFile::modeWrite)!=0) • { • CNewFriend *pdlg = new CNewFriend(); • pdlg->DoModal(); • CFriend Friend; • Friend.m_strId = pdlg->m_strId; • Friend.m_strIp = pdlg->m_strIp; • Friend.m_strName = pdlg->m_strName; • Friend.m_strIntroduce = pdlg->m_strIntroduce; • CFriend *pFriend = new CFriend; • *pFriend = Friend; • CString temp = pFriend->GetTotal(); • File.Write(temp,temp.GetLength()); • File.Write("\n",1); • delete pdlg; • delete pFriend; • } • File.Close();
5. Implementation of the System–Module • State check class CMessenger { //functions public: CMessenger(CListControl *pListControl); virtual ~CMessenger(); bool Initiate(SINGLELIST *pSingleList); bool NewCheckList(); bool DeleteCheckList(); void ConnectionState(); bool SendFileInfo(CString Ip,CString FilePathName); //variables public: //CCheckTransfer m_CheckTransfer; CCheckWait m_CheckWait; SINGLELIST *m_pSingleList; SINGLELIST m_CheckList; CListControl *m_pListControl; CCriticalSection *m_pCritical; CWinThread *m_pCheckStateThread; CFileThread *m_pFileThread; bool m_bCheckState; }; UINT CheckStateThread(LPVOID pParam); #endif // !defined(AFX_MESSENGER_H__B70377BD_30B6_45CD_B1DA_A226E29E9954__INCLUDED_) Class Definition
5. Implementation of the System–Module • Chatting Module • Create Thread • ChatTransfer ///////////////////////////////////////////////////////////////////////////// // CChatThread IMPLEMENT_DYNCREATE(CChatThread, CWinThread) CChatThread::CChatThread() { } CChatThread::~CChatThread() { } BOOL CChatThread::InitInstance() { // TODO: perform and per-thread initialization here return TRUE; } int CChatThread::ExitInstance() { // TODO: perform any per-thread cleanup here return CWinThread::ExitInstance(); } BEGIN_MESSAGE_MAP(CChatThread, CWinThread) //{{AFX_MSG_MAP(CChatThread) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CChatThread message handlers bool CChatThread::Initiate() { if(!m_ChatWait.Initiate()) return false; return true; } Class Definition
5. Implementation of the System–Module • Chatting Module • Create Thread • ChatTransfer ///////////////////////////////////////////////////////////////////////////// // CChatTransfer command target class CInstantmsgDlg; class CData; class CChatTransfer : public CSocket { // Attributes public: CInstantmsgDlg *m_pMsg; int m_state; enum State{Server,Client}; CSocketFile *m_pFile; CArchive *m_pArchiveIn; CArchive *m_pArchiveOut; CWnd *m_pWnd; // Operations public: CChatTransfer(void *pClientDlg); CChatTransfer(CInstantmsgDlg *pDlg); virtual ~CChatTransfer(); virtual bool Connect(CString *pIp); void operator << (CData &data); void operator >> (CData &data); void Flush(); void Send(CData *pData); void Receive(CData *pData); void Init();//It should initiate after connecting Class Definition • Class Name: CchatTransfer • Member Function • Connect • Receive • Send • Member Variables • m_pFile • m_pMsg • m_state
5. Implementation of the System–Module • Manager List • State check • Chatting Module • Transfer Module • Open • Select file • Sender • Check result class CFileTransfer : public CSocket { // Attributes public: Cfile *m_pHFile; CSocketFile *m_pFile; Carchive *m_pArchiveIn; Carchive *m_pArchiveOut; CWnd *m_pWnd; CProgressDlg *m_pDlg; bool m_bReceiving; bool m_bFinish; bool m_bLast; int m_intLastCount; int m_intLastLength; int m_FileSize; int m_FileDivy; int m_CountFileDivy; int m_FileRest; DWORD m_CurFilePosition; // Operations public: CFileTransfer(); virtual ~CFileTransfer(); virtual bool Connect(CString *pIp); bool FileOpen(CString *pFilePathName); void operator << (CFileData &data); void operator >> (CFileData &data); void Flush();
5. Implementation of the System–Module ///////////////////////////////////////////////////////////////////////////// // CCheckTransfer command target class CCheckTransfer : public CSocket { // Attributes public: // Operations public: CCheckTransfer(CFriend *pFriend); virtual ~CCheckTransfer(); CFriend m_Friend; bool m_bConnected; int m_intTimeout; bool Connect(CString *pIp); // Overrides public: // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CCheckTransfer) public: virtual void OnReceive(int nErrorCode); virtual void OnClose(int nErrorCode); //}}AFX_VIRTUAL // Generated message map functions //{{AFX_MSG(CCheckTransfer) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG // Implementation protected: }; • Transfer Module • Open • Select file • Sender • Check result
5. Implementation of the System–Messenger S/W Tray State Running State Chatting GUI-User Send Message Chatting GUI-Friend
5. Implementation of the System–Messenger S/W Friend Inform Add New Friend File Send Select File
6. System Open–List of the Problems • MF71D.DLL does not exist on Ta suong Phung’s Computer(English Windows) • Solution : • Change compile option (Dynamic Link Library Static) • Copy MF71D.DLL file to same directory with *.exe • After change compile Option, Some Function dose not working as follow • Can’t control Friend Function • Program Down • Solution : • Change compile option (Dynamic Link Library & Debug) • Copy MF71D.DLL file to same directory with *.exe
6. System Open–List of the Problems • In Chatting Window, Input some word and enter keyboard then friend just can see blank space • Solution : • Change Action State : Read Only • Prevent “Enter Event” in • the chatting window My messenger Friend messenger Just see word!!
CONCLUSION • Objective of term project: base on the theory of Object-Oriented Modeling and Design, make the model for implementation. • Targeted model: messenger programming • Analysis and Design the model through: • Object Modeling • Dynamic Modeling • Functional Modeling • Implementation: using C++ • Because of the limited of time, our model still has some small problem needed to be improved in further.