Category Archives: ‘corePHP’

‘corePHP’ open source technology solutions for business, non-profits, and government agencies. ‘coreTechnology’ blog for technology and business experts.

4 Project Management Challenges Dev Teams Have to Face and How to Tackle Them

Business people discussing presentation together: experienced female project manager pointing at laptop screen while explaining information to young man

Project management is a challenge. Software development project management is even more of a challenge, whether you develop new software applications, work on infrastructure related projects, or maintain web based solutions. However, the challenge isn’t insurmountable, and there are things you can do to manage these issues better. Here are four project management challenges dev teams have to face and how to tackle them. Continue reading

7 Crucial SEO Mistakes to Avoid in Content Optimization

Whether you are a career blogger or work as a content creator for companies with dedicated blog sections, optimizing your original content for SEO ranking is an essential part of the process. According to SEO Tribunal, 93% of online experiences begin with search engine queries, while 72% of marketers agree that brand relevancy is the main deciding factor for SEO improvement.

If your products and services are popular and respected on the market, your blog’s performance and user engagement will reflect the brand reputation you’ve built up. However, it’s not always enough to create content and publish it without additional optimization or regards for global SEO trends.

It’s quite easy in fact to make crucial mistakes which can lower your Search Engine Result Page (SERP) ranking and thus affect your traffic and revenue as a result. With that said, let’s take a look at several noteworthy SEO mistakes which you should avoid in content marketing and optimization going forward. Continue reading

How localization helps you boost e-commerce business

shipping products at an e-commerce business

If you want to experience international growth or if you are thinking about localization of your e-commerce website, then you need to do proper planning. For e-commerce localization to become a successful strategy for your business, you will need to take time. Prepare and plan properly. It is complicated to break into international markets. Offering the product through shipping is very expensive and attracting global traffic is not easy. You need to know your target market and should adapt your product to global preferences and construct confidence between your business and your clients. As e-commerce localization of your content accomplishes success. It is the right time to expand your business globally so that you can be recognized as global leader-commerce localization will achieve. Continue reading

How Business Intelligent Tools Help You Generate More Leads

Business Intelligence

In today’s competitive and digital marketplace, a lot of business owners are having a hard time coping up with how to gather and analyze business data. There’s too much information to process and analyze. As a result, many companies are struggling to grow because they don’t know where to start, what’s needed, and how long it takes for them to see some positive results.

Fortunately, technology has produced a solution for companies who are struggling to collect and analyze valuable business data at the same time, that is, business intelligence tools.

Business intelligent tools (BI tools) refers to computer software or tools that allow a company to collect valuable business data to create reports. The business data gathered can be about a specific department or may give an overall outlook of the company’s current status.

But, to get the most out of your BI tools, you need to choose a software or system that’ll automatically analyze the content and context of the data that it has collected.

In this article, we’ll talk about how BI tools can help generate more leads for your business. Continue reading

The 10 Best WordPress Plugins for Ecommerce

Wordpress plugin

The number of online stores is growing every year, and so is the list of WordPress plugins.

WordPress plugins not only help in enriching the functionalities of your ecommerce website but also free up plenty of your time.

You need many different types of plugins to sell your products and services online. If you come to think of it, WordPress plugins provide the same benefits as SaaS products.

Here we are discussing some of the best WordPress plugins for ecommerce that you should try out: Continue reading

EVERYTHING YOU SHOULD KNOW ABOUT CAREER IN NETWORKING

Networking with people

A lot of people consider IT networking to be an appealing career. Nevertheless, it is one of the most popular carriers not only among the youth but older people. Now some argue that there is a serious lack of qualified people in this industry. Some also think networking is a fairly easy way to gain a good position in a fast-growing corporation. Nowadays it is the most sought after and high-paid job in the USA.

Want to know how to become a high-demanded specialist in IT? Being a giant in online job searching, jobsora.com reveals all the secrets of how to get a decent job as well as the features a good specialist you should obtain. Moreover, the resource offers the hottest vacancies in the field. Continue reading

Powerful SEO and Website Optimisation Tips To Consider For Good Results

Website optimisation is a critical factor in boosting your rank on search engines. It allows you to increase awareness for your brand, as well as entice potential customers to view your products and services. To supplement gaining exposure and traffic for your website, you must create a valuable experience for your site visitors so that they will keep coming back.

Here are some powerful SEO and website optimisation tips that you should use for your site: Continue reading

Secure Web Application Development Best Practices

In an age of record data breaches and ransomware attacks, website and app security should be the number one concern for site designers and developers. Users have a right to expect that their apps are easy to use and protect their personal and financial information.

Rather than conducting a cleanup after the fact, putting security first at every level of the development and launch process will save time, money, and maybe more importantly, your reputation.

Top Security Concerns for Web App Developers

The year 2017 was dubbed the “Year of the Data Breach,” breaking records for both the number and severity of data leaks and hacks. Data breaches can cost millions of dollars to remedy and cause irreparable damage to your brand. Many smaller companies go out of business within six months of an attack, unable to withstand the financial strain.

Still, app development is big business, with more than 4 million apps on the market at any given time. Revenues are in the billions and rising. In such a competitive atmosphere, it’s tempting to sacrifice security for speed. More than 80 percent of CIOs list balancing security concerns with marketing deadlines as their main challenge. But, these issues aren’t mutually exclusive. Using app developer security best practices makes it easier to launch on time without some of the unintended consequences of rushing to market. Continue reading

Is Press Release Distribution Right For Your Business: 9 Benefits you Can’t Ignore

 

Press Release Marketing

Do you have a new product, celebrating a milestone, or planning to collaborate with a top 500 company? Press release distribution is a way to go.

If you’re not yet including it as part of your marketing strategies, you are missing a lot of potential benefits that your business should be experiencing. It can be a great tool to reach wide boundaries and grow your business.

Are you aware of these benefits? Here are things that you may be missing, so you’ll work on including it in your tactics: Continue reading

Link Building 101 – Master the Backlinks

So if you are reading this, then I guess you know about link building(Or maybe at least you are familiar with backlinks). Using link building you can increase the visibility of your online business in search results.

As you may know, most of the people use Google to search for different things. And google tries to provide the best results for the search query.

To provide the best results, Google constantly updates his algorithm to remove the spammy sites from search results.

Now, these algorithmic updates may result in a ranking drop of your site if you have to build your backlinks using black hat tactics.

When building backlinks there so many things you have to keep mind and once you master the formula you will be on your way to build quality backlinks for your website. Continue reading

How To Manipulate Source Code Using Java Annotation Processing API

word-image

Technology

The source level annotations are introducing in Java 5, it provides the features to create additional source files during the compilation stage.

The source code files are not limited to java files, files can be any kind like metadata, documentation or any type of resource.

Annotation Processing API is actively used in many open source frameworks like Spring Query DSL and JPA etc.

The limitation with this API is it only used to generate new files, it will not modify the existing files.

Execution

word-image

The annotation processing is done at multiple rounds. Each round starts with compiler searching for the annotations in java source, choosing the annotation processors suited for these annotations, each annotation processor is called in corresponding sources.

If any files are created during the process, another round start with generated source files as input, it will continue until no new files are generated during the processing stage.

The annotation processing API is located in the javax.annotation.processing package. The main interface that you’ll have to implement is the Processor interface, which has a partial implementation in the form of AbstractProcessor class. This class is the one we’re going to extend to create our own annotation processor.

Setting Up the Project

For demonstrations of annotation processing, we will spilt our project into 2 modules, one of them annotation-processing module which will contain annotation processor, another will be annotation-user module.

First, we will implement annotation-processing module, for annotation processing we are going to use Google`s auto-service library which used to create processor meta-data.

It is recommended to use Google auto-service and maven compiler plugin latest versions found in Maven Central Repository.

<properties>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<auto-service.version>1.0-rc4</auto-service.version>

</properties>

<dependencies>

<dependency>

<groupId>com.google.auto.service</groupId>

<artifactId>auto-service</artifactId>

<version>${auto-service.version}</version>

<scope>provided</scope>

</dependency>

</dependencies>

<build>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.8.0</version>

<configuration>

<release>11</release>

</configuration>

</plugin>

</plugins>

</build>

And annotation-user simply use annotation-processor as its dependency.

<dependency>

<groupId>org.sravan</groupId>

<artifactId>Annotation-Processing</artifactId>

<version>${project.version}</version>

</dependency>

Let’s create a @BuilderProperty annotation in the annotation-processor module for the setter methods. It will allow us to generate the Builder class for each class that has its setter methods annotated:

@Target(ElementType.METHOD)

@Retention(RetentionPolicy.SOURCE)

public@interfaceBuilderProperty {

}

The @Target annotation with the ElementType.METHOD parameter ensures that this annotation can be only put on a method.

The SOURCE retention policy means that this annotation is only available during source processing and is not available at runtime.

Implementing Processor

word-image

AbstractProcessor is the abstract implementation of Processor interface, now lets extends the this class and implement the abstract methods.

@SupportedSourceVersion(SourceVersion.RELEASE_8)

@SupportedAnnotationTypes(“org.sravan.annotation.processor.BuilderProperty”)

@AutoService(Processor.class)

publicclass BuilderProcessor extends AbstractProcessor {

@Override

publicboolean process(Set<? extends TypeElement>annotations, RoundEnvironment roundEnv) {

returnfalse;

}

We should specify the annotations that this processor is capable of processing and also source code version. This can be done either by implementing getSupportedAnnotationTypes and getSupportedSourceVersion of the Processor interface or by annotating your class with @SupportedAnnotationTypes and @SupportedSourceVersion annotations.

And the process method returns true if all supported annotations are processed, and don’t want to process by another annotation processor down the list.

@AutoService annotation is itself processed by the annotation processor from the auto-service library. This processor generates the META-INF/services/javax.annotation.processing.Processor file containing the BuilderProcessor class name.
annotations variable in process method will contain all the annotation types found in the class.

RoundEnvironment instance to receive all elements annotated with the @BuilderProperty annotation.

for(TypeElement annotation: annotations)

{

Set<? extends Element>annotatedElements = roundEnv.getElementsAnnotatedWith(annotation);

}

@BuilderProperty annotation’s user could erroneously annotate methods that are not actually setters. The setter method name should start with set, and the method should receive a single argument. So lets separate the methods which are correctly annotated and other erroneously annotated methods using Collections.partitionBy() collector.

Map<Boolean, List<Element>>annotatedMethods = annotatedElements.stream().collect(Collectors.partitioningBy(element -> ((ExecutableType)element.asType()).getParameterTypes().size()==1 &&

element.getSimpleName().toString().startsWith(“set”)));

List<Element>setters = annotatedMethods.get(true);

List<Element>otherMethods = annotatedMethods.get(false);

We should warn the user if the method is incorrectly annotated, for this we can use AbstractProcessor.processingEnv protected field.

otherMethods.forEach(element ->processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, “@BuilderProperty must be applied to a setXxx method with a single argument”, element));

and also if the correctly annotated methods are not present then we can skip the current iteration.

if(setters.isEmpty())

{

continue;

}

Then we need to get the fully qualified class name using setter methods using below code.

String className = ((TypeElement) setters.get(0).getEnclosingElement()).getQualifiedName().toString();

we will store setter methods name, and argument type in map and use it iterate to generate source file.

Map<String,String>setterMap = setters.stream().collect(Collectors.toMap(setter ->setter.getSimpleName().toString(), setter -> ((ExecutableType)setter.asType()).getParameterTypes().get(0).toString()));

Now lets create Person class in annotation-user module like below,

publicclass Person {

privateintage;

private String name;

publicint getAge() {

returnage;

}

@BuilderProperty

publicvoidsetAge(intage) {

this.age = age;

}

public String getName() {

returnname;

}

@BuilderProperty

publicvoid setName(String name) {

this.name = name;

}

}

Running the Example

Although the Java Annotation Processing API is easy but sometimes you would need a custom development to do the source level annotation.

If you don’t want to go through all that trouble I would suggest you should consider Java development outsourcing which is rather easy and hassle-free.

Anyways moving on, now if we compile annotation-user module below java file is generated under annotation-user/target/generated-Sources/annotations/com/baeldung/annotation/PersonBuilder.java and it will look like below:

package org.sravan.annotation;

public class PersonBuilder {

private Person object = new Person();

public Person build() {

return object;

}

public PersonBuilder setName(java.lang.String value) {

object.setName(value);

return this;

}

public PersonBuilder setAge(int value) {

object.setAge(value);

return this;

}

}

Conclusion

In this content, we learned how source-level annotations are processed to generate the source files using the Google Auto Service Library.

The Source code can be found in the attached zip file.

https://drive.google.com/file/d/1z0sszFN47JZAYimd1oexHF2v7bGZQ1Vb/view?usp=sharing