不是吧,你还只会用@Service注册Bean吗?

Spring Bean注册与配置详解 通过上述分析,我们可以看到Spring框架提供了灵活而强大的机制来注册和管理Beans。无论是使用JavaConfig还是XML配置,理解组件扫描和注解的使用都是至关重要的。希望本文能帮助你更好地掌握Spring Bean的注册与配置。 阅读详情

前言

众所周知,在我们平时的开发中,Spring这个框架已经环绕了整个项目,不是说我们不能不用Spring,而是这样做的代价太大了。每次面试,总是会问道Spring IOC、AOP、事务等等,今天这篇的话是猛男我刚工作碰到的一个面试真题,可怜我那时只知道@Service。然后就回去等通知了,到现在还没有给我通知。

另外的话,今天这篇会讲几种注入方式,至于原理好哥哥们就先别想了(别打我脸就行),这随便拿一个出来都得讲源码讲一遍,主要需要依赖的东西优点多,所以找个机会将Spring IOC 那一块的源码弄出来说说,这一篇的话主要是讲个大概。

不是吧,你还只会用@Service注册Bean吗?

 

1.@Service、@Component、@Repository、@Controller

这种方式就很简单,像@Service、@Repository其实还是用的@Component,在注解里面点击去看就知道了,需要注意的点是这种方式需要用@ComponentScan配置一个一个扫包范围。为什么不用@Component这一个呢,主要是Spring为了区分Bean的类型。@Repository作用于持久层,@Service 作用于业务逻辑层,@Controller作用于表现层(spring-mvc的注解)

@Component
public class ApproveCenterServiceImpl implements ApproveCenterService {
}
@Service
public class ApproveCenterServiceImpl implements ApproveCenterService {
}
@Repository
public class ApproveCenterServiceImpl implements ApproveCenterService {
}

2.

Windows 10下Gpg4win 4.3.1安装与配置全攻略:从下载到邮件加密实战 本文详细介绍了在Windows 10系统下安装和配置Gpg4win 4.3.1的全过程,包括下载、验证、自定义安装以及密钥管理。特别重点讲解了如何通过Kleopatra证书管理器进行密钥创建和管理,以及在Outlook中实现邮件加密的实战操作,帮助用户全面提升数据安全防护能力。 阅读详情

相关推荐

台达B3伺服电机485通讯的调试过程

最近上了一项目,没办法直接把B3伺服接到PLC上去,怎么办?偶说试下直接电脑通过100多米的485线控制好了,定型前的测试就这样展开了。 1、焊CN1口 如果不安装CN1,是开不了机的,要报很多错误,比如SERV EMG ALERT, 上限报警,下限报警什么的,怎么办?直接焊好CN1头子吧,烦了点,但是必要的。 主要接的是11,9,10,32,31,30几个脚,按照图上连接好就是了。 2、 接线路 按照上面的图,接上伺服电机线,编码器线,电源线,包括限位常闭开关、485连线等,就完..

shidong01的博客 1万+

CANoe的安装教程

CANoe的安装教程

weixin_59090531的博客 1万+

【点云语义分割】Ubuntu20.04下RangeNet++环境配置与实战指南

本文详细介绍了在Ubuntu20.04系统下配置和运行RangeNet++点云语义分割模型的完整实战指南。内容涵盖从Cuda、cudnn到TensorRT的深度学习环境搭建,RangeNet++源码编译的详细步骤与常见问题解决,以及如何运行首个分割Demo并可视化结果。最后,还探讨了处理自定义点云数据格式和进行性能调优的进阶技巧,旨在帮助开发者和研究者快速部署并应用这一先进的点云语义分割技术。

rnn9storyteller的博客 519

FOFA奇技淫巧:从搜索语法到实战场景的深度挖掘

本文深入探讨了FOFA搜索语法在网络空间测绘中的高效应用,从基础语法到实战场景的深度挖掘。通过渗透测试、威胁狩猎、资产发现等实际案例,展示了如何利用FOFA精准定位目标系统、识别蜜罐、追踪威胁,并提供了合规使用指南和性能优化技巧,助力安全工作者提升效率。

weixin_32428571的博客 239

转换shp坐标系之前,设置转换的投影

1.点击目录》工具箱》系统工具箱》Data Management Tools.tbx》投影和变换》创建自定义地理(坐标)变换 2.名称自定义 2.输入地理坐标系可以根据所需要转换的shp文件属性中查询出来 把图层拖入arcgis中,右键属性即可查看 3.复制坐标系,点击“输入地理坐标系”右侧的按钮后,粘贴在顶部搜索框中,并按enter键,选择对应的坐标系 4.点击“输出地理坐标系”右侧的按钮后,选择转换后的坐标系,如4326,选择后点击确认按钮。 5.自定义方法中选择

Wangwangwang___的博客 1866

山景BP10_128DBG开发板ADC_Key驱动

最近在学习山景BP10_128DBG开发板,想使用开发板上的按键。看了看原理图和之前用过的按键好像有点不一样。常见的按键都是判断IO口是否被拉低或拉高来判断按键是否被按下。山景BP10_128DBG开发板上的按键是ADC按键,每个按键按下之后ADC的采样值是不同的,通过ADC采样回来的值进而判断哪个按键按下。这种方式核心思想就是用一个ADC通道来节约IO口,对于IO紧张的芯片是一个不错的解决思路。

weixin_56646002的博客 1311

【Frida Android】实战篇8:客户端证书认证绕过 Hook 教程

通过重写类的方法,自定义证书校验逻辑;利用配置文件,从系统层面管理证书信任策略;以及通过 OkHttp 框架提供的方法,实现证书的强绑定校验。这些内容主要围绕客户端如何验证服务端证书的合法性展开。客户端证书认证。当 APK 预置了客户端证书,并且服务端会对客户端证书进行校验时,传统的中间人攻击方式将面临新的挑战。我们将深入分析这种场景的工作原理,并详细介绍如何通过技术手段获取客户端证书、配置中间人工具,最终成功实现抓包分析。

水滴石穿 1430

DAMMFND: Domain-Aware Multimodal Multi-view Fake News Detection

虚假新闻的泛滥不仅严重阻碍了互联网社交媒体的健康发展,还在政治、经济和社会层面造成了实际危害,凸显了自动化虚假新闻检测的重要性(Zhou 等,2015;Cui 等,2019;Zhu 等,2022a;Li 等,2024c,b,a)。现有的虚假新闻检测方法通常聚焦于特定领域的新闻,例如健康或政治领域。然而,在现实世界中,社交媒体上的新闻往往跨越多个领域,这就要求现有的虚假新闻检测方法必须考虑多域泛化(Nan 等,2021;Qi 等,2019;Zhu 等,2022b)。

qq_52053775的博客 340

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

上一篇: 自定义SpringBoot默认MVC配置?好几个坑,避一避
下一篇: 我今天才知道,原来TCP为了保证可靠传输做了这么多
爱玛士
博客等级 码龄7年 720粉丝 253原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值