ChaseDream

标题: Design class [打印本页]

作者: 珍妮王小钰    时间: 2019-9-17 12:36
标题: Design class
override???  所有的java 都可以; abstract 只能在method;

implement  可以好几个interface(list 继承collection
?)

OOD  设计整个程序,怎么去设计class;

答疑环境,解决问题都第一步是描述问题;  

继承 共性:base class、 基类,

一个class的内部叫nested class嵌套类,内部类; 子类或者派生类
现实生活中有问题,用code 模式化like 员工管理程序;

继承就是: base class,
implement 只能跟 interface
contra   继承 只能class( 默认class 都是;特殊的是 abstract class工具,) 例题 不想去限制算法,只想限制API




class



















作者: 珍妮王小钰    时间: 2019-9-19 09:50
designer  problem solver~~
设计思想的
OOP programming
类和对象;
OOD:
Object Oriented Programming ,basic steps in OOD
Design patterns
More advanced examples

why learning OOD?
1. practical problems -->Model --> Code
2. Better understanding of OOP
3. How to write good code?

looc java source code designed APi good or not good?















作者: 珍妮王小钰    时间: 2019-9-24 07:06
ES6  声明变量  let 和 const

console.log(flag);
var flag = 123;
//undefined

vs
console.log(flag);
let flag = 123; is not define!
let声明的变量不存在预解析



var flag = 123;
var flag= 456;
console.log(flag);
//var : 456覆盖了,
但是let声明的变量 在同一作用域内不允许重复!

ES6 引入了块级作用域
块内部定义的变量,在外部是不可以访问的
if(true){
      var flag = 123;
    let flag = 123;
}

{//这里是块级作用域;
    let  flag = 111;
    console.log(flag);//这样可以访问
}
console.log(flag);不能访问;











作者: 珍妮王小钰    时间: 2021-10-23 14:07
make a global plan for how this work. figure out how to solve each of these subtasks. Later on, this is sort of a general idea with algorithms, when you're developing them.What you don't want to do is write line one of the algorithm and then write line two of the algorithm and thenThree of the algorithm,
but you want to do is write the algorithm in chunks and plan out what the chunks are going to be and then go into each chunk and write that in more detail and so on.
So, develop your algorithms sort of breadth first rather than depth first, just the way that we recommend doing with fruits, write out the cases then the case.
The case delimiters分隔符 before you go into each case and fill in the details.



And the idea is that this is a smaller instance of exactly the same problem. So, the question is how do I know that this works.The same thing is true here.
I need to make sure that the problems that I'm solving by these recursive calls, really are smaller instances of exactly the same problem


But as a general rule, it's really only going to get confusing if you try to unpack that it's really important to think when you're designing the algorithm recursion is magic. As long as you follow the rules. Smaller instance of exactly the same problem. It'll work out fine. When we're generally when we're designing algorithms, we don't just want to know that we've solved the problem correctly.





欢迎光临 ChaseDream (https://forum.chasedream.com/) Powered by Discuz! X3.3