Sunday, April 10, 2016

Java :OOPS Design Rules

OOPS Design Rules

Software :
  1. Perform what it supposed to.
  2. Flexible (by adding OOPS)
  3. Maintainable and Reusable

Object
  1. Object naming should be related to its operation
  2. Each object should not perform unrelated activities
  3. There should not be any unused properties or fields.
  4. Encapsulation helps divide application into logical parts.
  5. Duplicate code should be encapsulated separately
  6. Encapsulate what varies to protect class from unnecessary chages
Delegation: Delegating the current task to  specialized object which is designed to handle that.

Textual Analysis of Use Cases : Nouns = Classes and Verbs =methods.

Interface Vs Class
Coding to Interface is better as user has option to extend open.

Extra Classes make softare inflexible and difficult to change

Monday, April 4, 2016

Find out which process is locking a file or folder in Windows

Find out which process is locking a file or folder in Windows




Have a look at Process Explorer (procexp.exe).
From its introduction:
Ever wondered which program has a particular file or directory open? Now you can find out.
To find out what process is using a specific file follow these steps:
  1. Go to Find, Find Handle or DLL.. or simply press Ctrl+F.
    Enter image description here
  2. Enter the name of the file and press Search.
    Enter image description here
  3. Process Explorer will list all processes that have a handle to the file open. Click on an entry to focus the process in the main window.
    Enter image description here
  4. Optionally, you can then even close the handle manually through the lower pane (Ctrl+L):
    Enter image description here