Blog: bugstack.cn
Precipitation, share, grow, let yourself and others can gain something! 😄
It’s hard to admit you’re good
Too many yards narrow the road
Holding one, spraying one, many code farmers are not a little more thinking to see the problem, always like to use a spear and shield to show their ability. Github you write an article saying you are not as valuable as open source code, you write open source code saying you this is not meaningful, then you ask him to contribute what, he only contributed mouth. Talk about theory blowing jingle, write code to make sparse bag
- Luckily, you’ll meet a lot of people along the way
good
, they can sincerely give you advice, provide ideas, help to solve, so that you have a group of beginner technical people, continuous growth. - This may be the soil for technical creation. If everyone does not fertilize the soil, but tries to step on it vigorously, then everyone can only die here together, and no one should innovate.Come on, I hope you can do something with me
2. What plugin did you write
In the past month, I have been working on the technical summary of case writing about the development of IDEA Plugin plug-in. I found a pain point in the process of daily coding development and the development of plug-in technology.
There are too many vo2DTO object conversion operations in the daily coding process, especially in the DDD architecture, there are a lot of anti-corrosion layers, and objects Po, VO, DO, DTO between these layers always need to be converted, and the use of BeanUtils more, later increment field name does not know what impact.
Of course, there is also a good tool MapStruct can ensure both performance and efficiency, but it needs to maintain the corresponding transformation class for each transformation object, is very suitable for the interface layer transformation, but those small method blocks, it is also a bit of trouble.
Therefore, Xiao Fu ge combined with the ability of IDEA Plugin plug-in development, through the mouse positioning to transform objects, a key to weave into the need to generate a bunch of X.et (Y.et) method, and in several optimization and can support the parent class object, Lombok plug-in. The demo diagram is as follows:
- Support: Copy an object, cursor position on another object, right mouse click Generate -> Vo2Dto to Generate conversion code
- Support: No copy object, directly in the conversion can generate empty set object, easy to add content freely
- Support: Annotation detection in the plug-in allows lombok to be used
3. Experience of releasing plug-ins
🤔 does not need English description originally, do not give me
1. Please describe it in English
- This is the first time I published a plugin and received an email reminding me to describe it in English in your plugin.xml.I haven’t read it. I thought it was spam
2. Please take screenshots in English
- Tell me that your screenshots should be in English so THAT I can pass you.
3. Saying my screenshots didn’t work
- “Are you sure you need this screenshot?” he said
4. Finally Posting
- Changed the comments, deleted the screenshots, finally the dawn.You say, do not post once, you will know this encounter!
Four, this plug-in arrangement
1. Install the plug-in
I get excited talking about this!
Why excited? I have been waiting for 2 weeks for the release of this plug-in. It takes 2 working days to review every modification, so all the mistakes I made above are worked out with time.
But now good, you can directly in the IDEA search to install small fu ge written plug-in, ha ha ha, this did not do a thing, always very exciting!
- See can search vo2DTO and successfully install and use, my heart is comfortable.No one can stand in the way of your most technical passion, even if you step on me
2. Introduction to usage
As shown in the figure, you only need very simple steps, can help you quickly and accurately generate the corresponding conversion code, in some scenarios is very Good! Operation steps:
- Copy the object
UserDto userDto
This is the converted object, copied to make it easier to generate the code that gets the properties.If you don’t copy, you’re generating empty code - Locate the object
User usxxer
Place the cursor over the object or property and click Generate -> Vo2Dto to Generate your object. - Note: Lombok is supported and objects are inherited, so if you encounter any other requirements or problems, please feel free to let me know
3. Share source code
- Source: github.com/fuzhengwei/…
- Note: with good technical people to build together will make a small thing continuously excellent, so I share this piece of code, we can work together to make a very short and exquisite product, to help us complete some convenient development processing.
Five, I’m sure quite stubborn
There is a stubborn may also be innate, I like technology, like to toss, like simple and clean things, and I set my mind to stick to it for a long time. Sometimes I know that another path would be easier and richer, but it is not in my heart. I am only what I realize I am, or I will never be what I am imposed on me.