MIT 6.033:计算机系统命名与资源抽象

需积分: 9 1 下载量 34 浏览量 更新于2024-09-13 收藏 28KB PDF 举报
"计算机系统工程课程6.033是麻省理工学院提供的开放课程,主要探讨计算机系统的构建与设计。课程的核心概念围绕着命名系统展开,强调系统由众多资源组成,这些资源通过名称进行连接,共同实现复杂的功能。课程将系统分解为三个基本类型:基础抽象、存储和通信。 1. 基础抽象:包括内存(mem)和磁盘等存储设备,以及数据结构如文件系统(FS)和硬盘阵列。这些抽象层确保了数据的组织和访问效率。例如,编程语言虚拟机(如Java VM)为编写程序提供了统一的接口,使得开发者可以忽略底层硬件差异。 2. 存储:存储是计算机系统的重要组成部分,它负责持久化数据,如内存(RAM)用于临时存储,而硬盘则提供长期存储。命名机制使得数据可以在这些不同的存储层次间无缝流动。 3. 通信:网络通信如以太网(wire)和互联网协议构成了计算机间的连接,SSH(Secure Shell)和Unix管道(unix pipe)是常用的应用层通信工具。这些技术允许不同系统之间的信息交换和协同工作。 4. 命名与粘合:在整个系统中,名字起着至关重要的作用。内存中的对象通过名称被标识,处理器通过执行指令来操作这些命名的对象,而通信连接则是通过命名实体进行的。命名不仅定义了资源的位置,还作为系统组件之间交互的桥梁,是系统设计的关键要素。 5. DNS(Domain Name System):域名系统是互联网上的一种命名服务,它将易于记忆的域名映射到IP地址,使得网络上的资源可以通过直观的名字而非数字地址进行访问,进一步强化了命名在分布式系统中的作用。 课程的目标是教授通用的技术和设计原则,使得在面对硬件更新换代时,软件依然能够高效、可靠地运行。通过理解并利用这些命名和抽象,学生可以更好地设计和优化现代计算机系统。在6.033课程中,学生将深入学习这些概念,并应用于实际的设计案例中。"

public class ComputerSystem extends JFrame{ private Vector<Computer> computers; private JButton button_Start; private JPanel panel0; private JDialog dialog_enter1; private final String[][] StaffLists = {{"p1","p1"},{"p2","p2"},{"p3","p3"},{"m1","m1"},{"m2","m2"}}; public ComputerSystem(Vector<Computer> computers){ this.computers = computers; setLayout(null); panel0 = new JPanel(); JLabel label = new JLabel(new ImageIcon("")); panel0.add(label); getContentPane().add(panel0); button_Start = new JButton("Click to login",new ImageIcon("ComputerStore.png"));//这个图片整不上去,最后整一个,好看 add(button_Start); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); button_Start.setBounds(5,5,400,150); button_Start.setHorizontalTextPosition(SwingConstants.RIGHT); button_Start.setVerticalTextPosition(SwingConstants.CENTER); button_Start.setFont(new Font("黑体",Font.BOLD,40)); public class Main { public static void main(String[] args) { //Computer[] computers = new Computer[999]; Vector<Computer> computers = new Vector<>(999); Scanner scanner = null; int i = -1; try { scanner = new Scanner(new BufferedReader(new FileReader("C:\Users\86137\Desktop\Computer.txt"))); String item; try { while (scanner.hasNext()) { i++; item = scanner.nextLine(); String[] cols = item.split(","); if(Objects.equals(cols[0], "Desktop PC")){ computers.add(new Desktop(cols[0], cols[1], cols[2], cols[3], cols[4], Integer.valueOf(cols[7]), Integer.valueOf(cols[5]), Integer.valueOf(cols[6]))); } if(Objects.equals(cols[0], "Laptop")){ computers.add(new Laptop(cols[0], cols[1], cols[2], cols[3], cols[4], Integer.valueOf(cols[8]), Integer.valueOf(cols[5]), Integer.valueOf(cols[6]), Double.valueOf(cols[7]))); } if(Objects.equals(cols[0], "Tablet")){ computers.add(new Tablet(cols[0], cols[1], cols[2], cols[3], cols[4], Integer.valueOf(cols[6]), Double.valueOf(cols[5]))); } // computers[i].category = cols[0]; // computers[i].Type = cols[1]; // computers[i].ID = cols[2]; // computers[i].Brand = cols[3]; // computers[i].CPU_Family = cols[4]; // computers[i].Price = Integer.valueOf(cols[5]); } }finally { if (scanner != null) { scanner.close(); } } } catch (IOException e) { e.printStackTrace(); } ComputerSystem computerSystem = new ComputerSystem(computers); computerSystem.setTitle("Computer Products Management System"); computerSystem.setSize(700,300); computerSystem.setLocationRelativeTo(null); computerSystem.setVisible(true); computerSystem.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); // TableFilterDemo demo = new TableFilterDemo(computers); } }这段代码为什么无法呈现按钮和图片。 一些类没给你,不影响

2023-05-25 上传