设为首页 收藏本站
查看: 1094|回复: 0

[经验分享] “多团队大规模”开发模式

[复制链接]

尚未签到

发表于 2015-9-17 13:06:09 | 显示全部楼层 |阅读模式
  应用SAP HANA “官方”开发模式的伙伴们在转到“多团队大规模”开发模式时会遇到各式各样的心理不适应的状况,各种纠结。比如GIT Repository和HANA Repository冲突什么的。
  这些问题主要是思路没有完全转换过来,两种开发模式在不断的“打架”。做一个简单的开发模式映射这样大家或许比较容易去接受“多团队大规模”的开发模式。这个映射不一定完全正确,主要是帮助大家理解。
  伙伴们想一想平常我们做JAVA或者.NET项目是怎么做的?一般情况是使用各种框架写JAVA/.NET的代码,然后用ORM映射数据库。写SQL Query时基本上都是在SQL里面去写,去测试然后拼接到自己的JAVA/.NET代码中。
DSC0000.png + DSC0001.png
  那么我们在SAP HANA平台上开发同样可以学习这样的模式,当然这种模式可能比“官方”模式厚重点,但是好处也是显而易见的,比如前文提到的那些好处。前后端的开发都可以在Eclipse中,HANA Studio的作用完全等同拼写检查SQL Query等SQL层面的工作。这样我们在开发过程中就可以应用很多手段,方便的传递参数。比如替换rootpackage,通过maven的插件就很容易的可以做到。这样HANA Instance就扮演了一个编译器的作用。前端的代码编译好之后,和后端代码整合到一起Activate到HANA Repository中,这时的Activate就像是compile一样。Maven的插件,或者Ant的脚本把Activate这些HANA特有的动作都封装起来,开发人员完全还是遵循着传统多团队大规模开发的模式——写代码,编译,调试等。
DSC0002.jpg + DSC0003.png
  由于Maven涉及到公司内部提供的插件,没有开源。所以就提供一个Ant的脚本以饷读者。



<project name="regi" basedir=".">
<description>Regi wrapper</description>
<!-- Properties for using REGI -->
<property name="userstore.key" value="BUILD"/>
<property name="userstore.cmdline" value="${client.dir}/hdbuserstore"/>
<property name="regi.cmdline" value="${client.dir}/regi"/>
<property name="regi.connection.args" value="--key=BUILD" />
<macrodef name="regi">
<attribute name="workspacedir" />
<attribute name="command" />
<sequential>
<!-- make sure the directory exists -->
<mkdir dir="@{workspacedir}" />
<!-- Create the workspace -->
<exec executable="${regi.cmdline}" dir="@{workspacedir}" failonerror="true">
<arg line="@{command}" />
</exec>
</sequential>
</macrodef>
<macrodef name="regi_apply">
<attribute name="workspacedir" />
<attribute name="command" />
<element name="files" />
<sequential>
<!-- make sure the directory exists -->
<mkdir dir="@{workspacedir}" />
<!-- Create the workspace -->
<apply executable="${regi.cmdline}" dir="@{workspacedir}" failonerror="true" relative="true" parallel="true">
<arg line="@{command}" />
<files />
</apply>
</sequential>
</macrodef>
<macrodef name="regi_setupuserstore">
<attribute name="workspacedir" />
<sequential>
<!-- Setup a key in the user store for use by REGI -->
<exec executable="${userstore.cmdline}" dir="@{workspacedir}" failonerror="true">
<arg line="SET ${userstore.key} ${hana.host} ${hana.user} ${hana.password}" />
</exec>
</sequential>
</macrodef>
<macrodef name="regi_createworkspace">
<attribute name="workspacedir" />
<sequential>
<!-- make sure the directory exists (needed for keystore operation) -->
<mkdir dir="@{workspacedir}" />
<!-- Create the workspace -->
<mkdir dir="@{workspacedir}" />
<exec executable="${regi.cmdline}" dir="@{workspacedir}" failonerror="true">
<arg line="${regi.connection.args} create workspace --force" />
</exec>
</sequential>
</macrodef>
<macrodef name="regi_export">
<attribute name="workspacedir" />
<attribute name="deliveryUnit" default="" />
<attribute name="vendor" default="" />
<attribute name="fileName" default="" />
<sequential>        
<!-- Export the desired delivery unit to the specified file -->
<regi workspacedir="@{workspacedir}" command="export @{deliveryUnit} @{vendor} @{fileName}" />
</sequential>
</macrodef>
<macrodef name="regi_track">
<attribute name="workspacedir" />
<attribute name="package" default="" />
<sequential>
<echo>regi track @{package}</echo>
<!-- Track the desired package -->
<regi workspacedir="@{workspacedir}" command="track @{package}" />
</sequential>
</macrodef>
<macrodef name="regi_commit">
<attribute name="workspacedir" />
<sequential>
<regi workspacedir="@{workspacedir}" command="commit" />
<regi workspacedir="@{workspacedir}" command="activate" />
</sequential>
</macrodef>
<macrodef name="regi_import">
<attribute name="workspacedir" />
<attribute name="import" />
<sequential>
<regi workspacedir="@{workspacedir}" command="import @{import}" />
</sequential>
</macrodef>
<macrodef name="regi_cleanpackage">
<attribute name="package"/>
<sequential>
<echo message="Deleting regi package: @{package}" />
<!-- Brutally crush any and all evidence of the repo objects for the passed package -->
<hdbsqlsql failonerror="false" sql="
delete from &quot;_SYS_REPO&quot;.&quot;ACTIVE_OBJECT&quot;   where PACKAGE_ID = '@{package}' OR PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;OBJECT_HISTORY&quot;  where PACKAGE_ID = '@{package}' OR PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;RUNTIME_OBJECTS&quot; where PACKAGE_ID = '@{package}' OR PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;PACKAGE_CATALOG&quot; where PACKAGE_ID = '@{package}' OR PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;INACTIVE_OBJECT&quot; where PACKAGE_ID = '@{package}' OR PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;ACTIVE_OBJECTCROSSREF&quot; where FROM_PACKAGE_ID = '@{package}' OR FROM_PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;ACTIVE_OBJECTCROSSREF&quot; where TO_PACKAGE_ID = '@{package}' OR TO_PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;INACTIVE_OBJECTCROSSREF&quot; where FROM_PACKAGE_ID = '@{package}' OR FROM_PACKAGE_ID LIKE '@{package}.%' ${line.separator}
delete from &quot;_SYS_REPO&quot;.&quot;INACTIVE_OBJECTCROSSREF&quot; where TO_PACKAGE_ID = '@{package}' OR TO_PACKAGE_ID LIKE '@{package}.%' ${line.separator}
"/>
</sequential>
</macrodef>
<macrodef name="regi_clean">
<attribute name="workspacedir" />
<sequential>
<delete dir="@{workspacedir}/._SYS_REGI_settings"/>
</sequential>
</macrodef>
<macrodef name="regi_checkout_trackedPackages">
<attribute name="workspacedir" />
<sequential>
<echo>regi checkout trackedPackages --force</echo>
<echo>workspacedir=@{workspacedir}</echo>
<!-- Checkout all packages that have been tracked. -->
<regi workspacedir="@{workspacedir}" command="checkout trackedPackages --force" />
</sequential>
</macrodef>
<macrodef name="regi_delete_packages">
<attribute name="workspacedir" />
<attribute name="packages" />
<sequential>
<echo>regi delete packages @{packages}</echo>
<echo>workspacedir=@{workspacedir}</echo>
<!-- Delete the desired package -->
<regi workspacedir="@{workspacedir}" command="delete packages @{packages}" />
</sequential>
</macrodef>
</project>

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-114980-1-1.html 上篇帖子: SAP产品简介_ZT 下篇帖子: [SAP ABAP开发技术总结]IDoc
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表