Monday, November 25, 2019
Time for JAVA #002 - constructor
Constructor is a block of code that initializes the newly created object. A constructor resembles an instance method in java but it’s not a method as it doesn’t have a return type.
This is how it looks like (the simplest declared constructor - no arg):
There are three types of constructors: Default, No-arg constructor and Parameterized.
1) If you do not implement any constructor in your class, Java compiler inserts a default constructor into your code on your behalf (it is invisible).
2) Constructor with no arguments is known as no-arg constructor. The signature is same as default constructor, however body can have any code unlike default constructor where the body of the constructor is empty.
3) Constructor with arguments(or you can say parameters) is known as Parameterized constructor.
Output will be:
Id: 00001 Name: Stalkerowaty
Id: 00002 Name: Stalkerowaty2
Although you may see some people claim that that default and no-arg constructor is same but in fact they are not, even if you write public Demo() { } in your class Demo it cannot be called default constructor since you have written the code of it.
Difference between Constructor and Method
The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code. Constructors cannot be abstract, final, static and synchronised while methods can be. Constructors do not have return types while methods do.
Quick Recap of all info:
1) Every class has a constructor whether it’s a normal class or a abstract class.
2) Constructors are not methods and they don’t have any return type.
3) Constructor name should match with class name.
4) Constructor can use any access specifier, they can be declared as private also. Private constructors are possible in java but there scope is within the class only.
5) Like constructors method can also have name same as class name, but still they have return type, though which we can identify them that they are methods not constructors.
6) If you don’t implement any constructor within the class, compiler will do it for.
7) this() and super() should be the first statement in the constructor code. If you don’t mention them, compiler does it for you accordingly.
8) Constructor overloading is possible but overriding is not possible. Which means we can have overloaded constructor in our class but we can’t override a constructor.
9) Constructors can not be inherited.
10) If Super class doesn’t have a no-arg(default) constructor then compiler would not insert a default constructor in child class as it does in normal scenario.
11) Interfaces do not have constructors.
12) Abstract class can have constructor and it gets invoked when a class, which implements interface, is instantiated. (i.e. object creation of concrete class).
13) A constructor can also invoke another constructor of the same class – By using this(). If you want to invoke a parameterized constructor then do it like this: this(parameter list).
Wednesday, November 6, 2019
Automation for JIRA #005 - How to set active link to @assignee in comment
The situation is like that:
There are two tasks. Task 1 and Task 2. Task 2 has a link set to "is blocked by" Task 1. Person who trasit Task 1 to status "Done" do not inform other person who is responsible for Task 2 (and can not work on it because it is blocked by Task 1).
I solved it with a simple automation:
What I could not find was a assignee name (but the active one) - there is a smart values like: {{assignee.displayName}} or {{assignee.key}} but those are displaying only the value. The correct instruction is [~accountid:{{assignee.accountId}}].
That displays like this:
There are two tasks. Task 1 and Task 2. Task 2 has a link set to "is blocked by" Task 1. Person who trasit Task 1 to status "Done" do not inform other person who is responsible for Task 2 (and can not work on it because it is blocked by Task 1).
I solved it with a simple automation:
What I could not find was a assignee name (but the active one) - there is a smart values like: {{assignee.displayName}} or {{assignee.key}} but those are displaying only the value. The correct instruction is [~accountid:{{assignee.accountId}}].
That displays like this:
Thursday, October 17, 2019
Time for JAVA #001
I want to learn. That is the first statement You have to understand to start. I found out a great site - exercism.io.
You can find there a lot of free exercises from many languages, and what is the most important You can consult your solution with a mentor.
Earlier today I finished one the execrises - named Reverse String.
The task was to write a code which will reverse a string for example: input: "cool" output: "looc".
Looks pretty easy but there are serveral ways to solve it.
In my opinion I found the simplest one:
The main issue of this problem is that String class does not have reverse() method, You need to convert the input string to StringBuilder, and after reversing You need to switch to String using toString().
I used gradle (please check it) for testing.
Back to Java is great!
You can find there a lot of free exercises from many languages, and what is the most important You can consult your solution with a mentor.
Earlier today I finished one the execrises - named Reverse String.
The task was to write a code which will reverse a string for example: input: "cool" output: "looc".
Looks pretty easy but there are serveral ways to solve it.
In my opinion I found the simplest one:
The main issue of this problem is that String class does not have reverse() method, You need to convert the input string to StringBuilder, and after reversing You need to switch to String using toString().
I used gradle (please check it) for testing.
Back to Java is great!
Tuesday, September 10, 2019
Automation for JIRA #004 - Cron in JIRA
Alright then... what is this Cron?
The software utility cron is a time-based job scheduler in Unix-like computer operating systems.
Users that set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration. This is what internet says about it. This is the shortest version I found - it is more : A cron expression is a string of fields separated by spaces
The task was to set creation of a new issue with reminder every wednesday. Sounds like a simple automation.
The automation has trigger "Schedule" (Executes this rule on the provided schedule.) To set it up correctly We need the CRON expression docs (or at least we should know it...) You can find the CRON expression docs here.
And here is an example code:
This literally translates to 0 second, 20 minute, 9 hour, any day of the month, Wednesday, January, 2014.
In plain English, this represents 9:20 AM on every Wednesday during January of 2019. Note, the "?" character means "no particular value".
This is complete chain of strings:
source: here
The software utility cron is a time-based job scheduler in Unix-like computer operating systems.
Users that set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration. This is what internet says about it. This is the shortest version I found - it is more : A cron expression is a string of fields separated by spaces
The task was to set creation of a new issue with reminder every wednesday. Sounds like a simple automation.
The automation has trigger "Schedule" (Executes this rule on the provided schedule.) To set it up correctly We need the CRON expression docs (or at least we should know it...) You can find the CRON expression docs here.
And here is an example code:
0 20 9 ? JAN WED 2019
This literally translates to 0 second, 20 minute, 9 hour, any day of the month, Wednesday, January, 2014.
In plain English, this represents 9:20 AM on every Wednesday during January of 2019. Note, the "?" character means "no particular value".
This is complete chain of strings:
source: here
Monday, July 22, 2019
Kanban - a PM tool? Differences between SCRUM
A kanban is an agile project management tool designed to help visualize work, limit work-in-progress, and maximize efficiency (or flow). Kanban boards use cards, columns, and continuous improvement to help technology and service teams commit to the right amount of work, and get it done!
That is a nice definition of the kanban which describe a whole idea. I really like it.
And here is a more precise and detail defition brought be Atlassian:
Kanban is a popular framework used to implement agile software development. It requires real-time communication of capacity and full transparency of work. Work items are represented visually on a kanban board, allowing team members to see the state of every piece of work at any time.
The work of all kanban teams revolves around a kanban board, a tool used to visualize work and optimize the flow of the work among the team. While physical boards are popular among some teams, virtual boards are a crucial feature in any agile software development tool for their traceability, easier collaboration, and accessibility from multiple locations.
Regardless of whether a team's board is physical or digital, their function is to ensure the team's work is visualized, their workflow is standardized, and all blockers and dependencies are immediately identified and resolved. A basic kanban board has a three-step workflow: To Do, In Progress, and Done. However, depending on a team's size, structure, and objectives, the workflow can be mapped to meet the unique process of any particular team.
The kanban methodology relies upon full transparency of work and real-time communication of capacity, therefore the kanban board should be seen as the single source of truth for the team's work.
Typical workspace in the Atlassian JIRA kanban board:
Scrum vs. kanban
Kanban and scrum share some of the same concepts but have very different approaches. They should not be confused with one another. A simple table with a comparison of the two methods.
source: atlassian.com/agile/kanban
Thursday, July 11, 2019
Automation for JIRA #003 - Epic linking
Guys from a Marketing deparment at our office wants clarity and order in their Jira kanban board.
Nice.
I wrote two new automations for them which are semi-complex but very interesting. I will discuss and share them below. The problem was to “sort issues” and always link them with an appropiate epic. When an issue is added (a task or a story), with a specified Atom (Atom is the unique specific name for the project) then create epic link to the appropriate Epic.
Ok, it sounds very simple but there is no such easy way to get there, plus I had to minded few exceptions.
The whole automation was divide into two.
The first one:
This automation is doing a linking thing while an Epic exists and when there is no Epic with a specific Atom then automation is creating it in the first place.
The Second one is doing “epic linking” with smart value {{destinationissue}}.
Why this automation can not be done in the one process? The answer is: The smart values can not be used in the JQL condition.
There are three if-else conditions. First one checks if there is story from issue labeled “releaseprocess” (the one from service desk), another condition checks if it is a story with the appropriate {{destinationIssue.issueType.name}} and the last one is for a task.
Nice.
I wrote two new automations for them which are semi-complex but very interesting. I will discuss and share them below. The problem was to “sort issues” and always link them with an appropiate epic. When an issue is added (a task or a story), with a specified Atom (Atom is the unique specific name for the project) then create epic link to the appropriate Epic.
Ok, it sounds very simple but there is no such easy way to get there, plus I had to minded few exceptions.
The whole automation was divide into two.
The first one:
This automation is doing a linking thing while an Epic exists and when there is no Epic with a specific Atom then automation is creating it in the first place.
The Second one is doing “epic linking” with smart value {{destinationissue}}.
Why this automation can not be done in the one process? The answer is: The smart values can not be used in the JQL condition.
There are three if-else conditions. First one checks if there is story from issue labeled “releaseprocess” (the one from service desk), another condition checks if it is a story with the appropriate {{destinationIssue.issueType.name}} and the last one is for a task.
Thursday, July 4, 2019
Automation for JIRA #002 - What is an issue?
Today let's move back to the beginning. A Jira foundations - issues.
I will try to compress this knowledge and explain it as simple as I can.
You can browse an Atlassian documentation to find many more useful information.
Issues are the building blocks of any Jira project.
An issue could represent an epic, a story, a bug, a task, or another issue type in your project. In my work I use issues that way: An epic is „a big thing” it is like a complete main menu screen for a game. Than it can be divided it into smaller pieces – stories. For example a story can be graphics for that menu. After that tasks come into action: graphics for buttons, a logo graphics, icons, etc... If it is needed also sub-tasks can be added to this complete tree of issues.
A subtask can be created for an issue to either split the issue into smaller chunks, or to allow various aspects of an issue to be assigned to different people. If you find a subtask is holding up the resolution of an issue, you can convert the subtask to an issue, to allow it to be worked on independently. If you find an issue is really just a subtask of a bigger issue, you can also convert an issue to a subtask.
To sum this up in JIRA Core, an issue is essentially a packet of work. You can create relations between them, adding attachments, adding and editing special fields, manage them.
source: confluence.atlassian.com
You can browse an Atlassian documentation to find many more useful information.
Issues are the building blocks of any Jira project.
An issue could represent an epic, a story, a bug, a task, or another issue type in your project. In my work I use issues that way: An epic is „a big thing” it is like a complete main menu screen for a game. Than it can be divided it into smaller pieces – stories. For example a story can be graphics for that menu. After that tasks come into action: graphics for buttons, a logo graphics, icons, etc... If it is needed also sub-tasks can be added to this complete tree of issues.
A subtask can be created for an issue to either split the issue into smaller chunks, or to allow various aspects of an issue to be assigned to different people. If you find a subtask is holding up the resolution of an issue, you can convert the subtask to an issue, to allow it to be worked on independently. If you find an issue is really just a subtask of a bigger issue, you can also convert an issue to a subtask.
To sum this up in JIRA Core, an issue is essentially a packet of work. You can create relations between them, adding attachments, adding and editing special fields, manage them.
source: confluence.atlassian.com
Subscribe to:
Posts (Atom)















