软件框架

本文主要介绍软件框架,包括WXWIDGET的构建和安装、示例和演示;Mac、Linux和Windows上的WX RPS的操作。软件框架由一组协作类组成,为应用程序的设计和开发提供了一种结构。通过学习wxWidgets的示例和演示和Mac/WX RPS等来深入的了解软件框架。
展开查看详情

1.CMPE 135: Object-Oriented Analysis and Design October 4 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor: Ron Mak www.cs.sjsu.edu/~mak 1

2.2 Software Frameworks A software framework consists of a set of cooperating classes . These classes implement the essential mechanisms for a particular problem domain . Example: wxWidgets is a C++ software framework for multi-platform GUI programming. A framework imposes a structure on the design and development of applications. It has classes and API that implement the structure. It is more than simply a library.

3.3 Software Frameworks , cont’d An programmer builds an application by: Subclassing framework classes. Adding new classes that provide custom functionality. Inversion of control The framework controls the execution flow. The programmer registers callback functions , mostly as event handlers , with the framework. The framework invokes the callback functions at the appropriate times, such as in response to events.

4.Building and Installing wxWidgets Go to https://www.wxwidgets.org to download for your platform. It’s a bit tricky to build and install. Mac: Fairly straightforward. I use Eclipse. Linux: I failed to build the dynamic libraries, so I built the static libraries instead. Windows: I successfully built for Microsoft Visual C++. 4

5.wxWidgets Samples and Demos The download includes the source code for many sample programs and several demos. The build scripts also build all these programs. Each has a makefile to build individually. Use the sample programs to learn how to code and use each widget. 5 Demo

6.wxWidgets Documentation Online tutorials: https://www.wxwidgets.org/docs/tutorials/ Online reference: https://docs.wxwidgets.org/3.0/ 6

7.wx -RPS: Mac OS X 7

8.wx -RPS: Debian 9.1 (Linux) 8

9.wx -RPS: Windows 10 9 Why does the app look so ugly on Windows?