Category Archives: Software Development

Java learned as so far:

Java variables,
Array, 2d array
Method
Different method invoking and return type
Class
– Class is actually a blueprint/specification/design
– A class can create as many as objects it needs to create
Object
– Earth is a software application where human and other thing is software objects.For creating object we need to create a human class
– Objects do particular behavior in a class
– Object exist only in application runtime actually when application is running
– Objects have identity,state and behavior

this keyword – it represent current object
Instance
Constructor – The costructor is a special method with the same name as the class and it’s used to instantiate objects from that class
– Every class has a by default constructor if we don’t put it manually
– The constructor is special method containing instructions for object creation. it can be said it is so called birth method. It has instructions for how the object will be born when the application starts up
Static keyword
Stack and heap memory
Garbage collection
Object oriented Programming = better organizing of code, it is a way to organize our code from multiple files by creating objects
Local variable
Reference variable
Instance variable
Inheritance
– Inheritance is the approach to get/transfer behaviour of one class to another
– We use extends keyword for inheriting, in inheritance we inherit from parent class which known as base class and the class which needs inheritation is known as child class or sub class/derived class
super keyword it extract constructor and it’s variable from parent class but reverse is not possible
Overrides
– Same method name with different purpose
– Same method name in parent class but in child class the method name is same but with different purpose
– Overrides means replace
– Override is not a good idea sometimes so we go for interface
Interfaces
– Interface is a contract with a class. The class needs to implements that method of the interface according to contract
– Interface has a method which does not need body, so it is just only to define, it is called as abstract method
– one parent class
– We use implements keyword while putting interface in a class
Abstract class
– When you don’t need all methods to invoke you can use abstract method, you can not make object from abstract class. Abstract method needs to be in abstract class. We use abstract keyword for both method and object to define abstract class and methods
– you can only extend abstract class but can not instantiate abstract class
– We can define abstract class as a type while creating object
Polymorphism

Loops
Exception Handling

Collection Framework
Wrapper class
Threading
Concurrency
Database

Jshell
Functional Interfaces
Lambda expressions

-Lambda helps us to use separate from associated object
– it can run without class
– We need to use lot of interfaces for this

Streams

Ei bold kora jayga diye project banaye banaye clear korte hobe
Italic kora jaygagula motamuti clear asey In Sha Allah, Alhamdulillah
The source is : Imtiaz Ahmed’s complete Java course

 

Master Object Oriented Design in Java course note

Association: It defines relationship between classes, it defines how the software will behave
Dependency Association: For example from code:

A driver receives a vehicle reference only as driver then only he can drive or accelerate

Composition: A particular object . It imply ownership
for example in this code:

Aggregation Association: It does not imply ownership

Here Department to SpanishCourse relation is composite

But Course to Student relationship is not composite because it does not imply ownership a student can take many courses or not

We find this relationship from above diagram, the block diamond and white diamond is the part of UML diagram

Forming Association between objects:

has a relationship in customer .

Now when to stop delivery

Overview of software design:
For example: Hospital Employee Management System
Task of the software:
Hire and Terminate Employees
Print Reports(XML,CSV Formats)

Problem Statement:
Current status of the software

Tips for design:
– You must draw design in paper or whiteboard don’t go to code directly
– Don’t overdesign or overdraw
– We have to develop iteratively but early steps should be kept simple
– Class names should be nouns based on their intention

Single Responsibility Priniciple(SRP): Not all the things in the same class

Don’t repeat yourself(DRY):

Arrow sign always describe that it is depends on that dependency class:

 


DAO=Data Access Object

Single Responsibility Principle Special Notes:
A class should have only one single reason to change

 

Open closed principle sayings about class design:

Classes should be open for extension but closed for modification.

Open Closed Principle and Strategy pattern:
Software modules should be open for extension and closed for modification
In development lifecycle software requirements needs to be constantly pour in. If developed need to change the already made codes the design is fragile. Fragile means broken.

So open closed principle save engineers from fragile design

instanceof operator we used here in the code:
HotelManagementSystem class:

Here it is like a junk drawer

So we will make it changes because it is violating OCP principle. This chamging process is known as Strategy pattern. So let’s do it.

We could also do it with interface class except abstract class

Example after applying Strategy pattern:
Nurse.java

Doctor,java

HospitalManagement.java

 

Employee.java

 

EmergencyRoomProcess.java

To String Tutorial:

DemoToString.java

Dependency Inversion Principle:
Device Manufacturing Company has:

The manufacturing process:
1. Assembly
2. Testing
3. Packaging
4. Storage

GeneralMAnufacturingProcess
UML diagram:

We depend on something in driving like car is stopping by traffic light
Imagine a life every car has different mechanism
Violation of Dependency Inversion Principle
When higher level modules depend on lower level ones succeptible to change
Dangers of coupling:
Tight coupling :

Well design software has single responsibility
This method says high level modules should not depend on lowlevel modules. It should depend on abstractions
Abstract classes and Interfaces don’t change as often as concrete classes/ derivatives
Cohesion means related things together.

This code I tried to run in class inside class but did not worked. Then I downloaded course code and run worked then again I tried to do with my directory structure then it worked.

Quizes from OOP course:
Q1:
Q2: The Dependency Inversion Principle states
Interfaces and abstract classes change far less often the concrete derivatives. Concrete classes should depend on Interfaces and abstract classes because they change less often and are higher level modules

Q3: In general the dependency inversion principle states that code should only depend on things that don’t change often
True
Liskov Substitution Principle:
Subtypes must be substitutable for their basetypes

There are some patterns which is not good known as Anti-pattern:
Here the link can be found


This is a ISA relationship, Nurse and Doctor depends on Employee class. Employee class is Abstract class

When it is adding a substitute teacher who does not work as like a teacher it violates the LISKOV pronciple as per this line of definition: Subtypes must be substitutable for their basetypes

So we changed to a new UML which does not violate LISKOV principle and did the code.

New UML:


Question 1:
The Liskov Substitution principle states, that child classes should not be substitutable in place of their parents.

Interface Segregation Principle:

Fat class is a class which has too many responsibilities.

CustomerTransaction

From Quiz: Main Kotha about Interface Segregation Principle:

This principle does not have to do with the number of dependencies that may exist in an application. The principle simply states that modules should not have dependencies on code they do not use.

If a module does not use functionality from another module, there is no reason to have a direct dependency between them. There should be an abstraction in between to segregate the 2 modules

Dependency Injection: 
When the application is not running there is no object because onbject only available in runtime, you will find only some classes

Tight Coupling:
Cohesion:
A very popular dependency injection implementation is spring framework bundled with spring container.

Dependency injection is

Dependency Injection Using Spring:
Observer Pattern:
The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

One basic UML diagram from wikipedia:

Created one for the course:

Builder Pattern:
When there is so many constructors and tough to handle it. Example codes with some bugs. Will do the solution later.

code example:
user.java

app.java

Factory Pattern:

UML Diagram:

codes:
Vehicle.java

VehicleFactory.java

App.java

VehicleType.java

ElectricCar.java

Car.java

Truck.java

Singleton Design Pattern: It only uses once in an application.

PerformanceStage

Application.java

 

 

Course Source Imtiaz Ahmed Master OOP Design udemy course
Best Book Rereference/Website reference for learning Java: https://beginnersbook.com/2013/12/java-string-equals-and-equalsignorecase-methods-example/

Why we need design patterns, the most important design patterns

Singleton
Facade pattern[fassad]
Adapter/Bridge pattern
Strategy pattern
Observer pattern

Design Pattern and Object oriented Data Analaysis

Writing here to clearing engineering concept of a software for future reference.

Example for Class, Constructors and Methods:

Main.java

User.java

Interface Example

 

 

 

Design Pattern:Cohesion in Java

I did not understand well from this link:
https://www.geeksforgeeks.org/cohesion-in-java/

Github in Ubuntu

 

 

 

Cyclometic Complexity

LICT .NET Training | Kamal Protap Sir | Part 6

19.11.17 Videos:
Relationships:
Inheritance, Association, Aggregation and Composition
These are except that inheritance
From the slide:
Association:
Relation between students and teacher. Both are independent.
Manager has a swipe card to enter the company premises Association
Inheritance:
A manager is a type of Employee. Employee is a parent of manager
Aggregation:
These kind of relationship is called Aggregations. It represents a Has-A relationship.
public class Manager{
//aggregation relation
public List<Worker> workers=new  List<Worker>();
//here worker is the child object and manager  is the parent object

}

public class Worker{

public string WorkerName=” “;

Worker object=new Objects;

}
Composition(Death Relationships)

StringBuilder:

It is very useful while string can make complexity in heap but StringBuilder helps to reduce it by modifed string.

System.Text.StringBuilder class can be used  and it comes from System.Text namespace

 

StringBuilder is mutable
StringBuilder performs faster than string when appending multiple string values

StringBuilder sb=new StringBuilder();

Use append method to add or append strings with StringBuilder
Use ToString() method to get the string from StringBuilder

Relationships Code and Videos:

 

  1. Manager( is a )type of employee(Employee is a parent of Manager) – Inheritance
  2. Manager ( has a ) swipe card to enter company premises – Association
  3. He has many workers under him.  – Aggregation relationship
  4.  His salary depend on project success. – Composition
  5.  Project success depends on a manager. –

I have completed the program may be I need to do it / practice it letter with heart. 🙂

C# IEnumerable vs IEnumerator

When we work with Collections in C# we need to iterate the items of collections. One way fo doing is this foreach loop.

 

The class should implenet IEnumerable interface. The IEnumerable interface also inehirts from IEnumerator interface/

 

 

 

codes:

 

 

LICT .NET Training | Kamal Protap Sir | Part 5

16/11/2017 vids

ExtensionMethod
Object Initializer
CollectionInitializer
QueryExpression
– It contains three clauses
from, where, orderby
Linq
IEnumerable

Diffrenet Datasource:
Array, Database, XML,LIST/Collection also datasource, File Concept also data source
Data we can able to store in known as data source
Data source: Where the data is available

Linq-Language Integrated Query
What is strongly typed ?

Strongly typed means:
Which show error immediately at a time of declaration that  is called strongly typed. It is also called compile time error.

Weakly typed means:
Which show error in runtime is called weakly typed like delegate.It is also known as loosely type.

Intellisense and Strongly typed is supproted in LINQ concept.

LINQ enabled data sources is very very important for interview:
LINQ to Objects : It means with array, arralist, etc.
LINQ to Datasets: It’s connected with ADO.NET
LINQ to SQL: It’s connected to SQL
LINQ to Entities: It’s connected to other data base like oracle or mysql
LINQ to XML: It’s connected to XML files

IQueryable
Where IQueryable is inherited from IEnumerable
IEnumerable

There are two expression in LINQ QueryExpression and methodExpression

Differed Execution:

 

Forced Execution:

 

Immediate:

LICT .NET Training | Kamal Protap Sir | Part 4

MVC Part:

Controller getting input.

ApplicationManagement video was so important

 

In Controller Folder HomeController.Cs is a controller which is controlling all the things

here is the code:

App_Start Folder:

RouteConfig.cs file we will find that

Views/Home/About
Views/Home/Contact

How to communicate with Controller and View:
ViewData and ViewBag passing the data from a controller to view

Interview questions:
ViewData: ViewData is dictionary of objects that is dervied from ViewData dictionary class and is accessible using string as keys.

ViewBag: viewBag is dynamic property. That take advantages of dynamic features.

both does not provide any compile time error.

 

In model we need to write the business logic.

In View we can show the actual things what we want to show:

View->Details.cshtml

Employee.cs

EmployeeController.cs

 

 

 

LICT .NET Training | Kamal Protap Sir | Part 3

09/11/2017 vids

Property:

Automatic Property:

Delegates:

Lambda Expression with FUNC:

Some logics:

Lambda using Function:

Multicast Delegates:

A delegate instance holding the multiple method at a time is multicast delegate.
But the rule is that all the method must be altered because all method in a single instance they remain present. Multiple reference method at a  time.

Anonymous Method:
Unnamed function. In the bracket we are writing the logic. Unnamed method we are writing the logic. Unanmed method.

 

The same AnonymousMethod work can be done in a single line with this lambda operation:

=> This is known as goes to operator and it is similar to AnonymousMethod()

Linq also using lambda not only Delegate

Func:

Func is a readymade function where the first data type is for input and the second one is for output. It does not need any delegate to declare.

Action:
Action does not support any return type:

 

 

 

 

 

 

DataReader and DataAdapter and DataSet

Difference Between DataReader and DataAdapter and DataSet:

Datareader: Datareader will be the best choice where we need to show the data to the user which requires no manipulation.

DataAdapter: DataAdapter read data from the database and is used to bind the data to the DataSet because DataAdapter working as a bridge between DataSet and the DataBase.

DataSet: DataSet is best suited where there is possibility of manipulation on the data.

 

 

In this article you will learn about the Connected And Disconnected Environment in ADO.NET.

 

LICT .NET Training | Kamal Protap Sir | Part 2

07.11.17 Vids
DataAdapater vs DataReader:

SqlDataReader row by row executes from the table

ExecuteReader() always executes the query to the data reader object.

Using data reader:

Using data adapter:

 

Difference between DataReader and DataAdapter:

Using data adapter:
First we call data adapter then data set

 

DataSet is a disconnected architecture
DataReader is a connected architecture

 

DataRow()

With DataAdapter:

Whole datagridview has been binded with the data.

 

Stored procedure in Our Application:

 

 

 

 

SqlConnection in ADO.NET

LICT Training Vids Summary

10.12.17: (This is one of the important videos)
AuthenticateLogic is very very important for project works: also the store procedure here is important

<authentication>

</authentication>

<authorization>
<deny users=”?”> //if it is * it means that it is open for all but ? sign means it is only for requested users
</authorization>

What is difference between connection string and appSettings ?

<appSettings>
<add key=””>
</appSettings>

<connectionStrings>

</connectionStrings>

 

LinqToSql Class

12.12.17: (This is one of the important videos)

For project works