2022年7月31日 星期日

Control M

 

https://www.gss.com.tw/control-m

https://www.youtube.com/watch?v=FjKnV_364Bc

https://www.youtube.com/c/BMCdocs/videos

https://www.youtube.com/watch?v=Fgd2lBY00JU

 

# Batch Job (Scheduling)

Ø  Batch Job read/ write interface file

Ø  Batch Job Trigger program processing (update status)

Ø  Batch Job email notification (email & SMS)

Ø  Batch job trigger reporting generation

 

Control M (enterprise)

Control M Server

Control M Agent

 

Enterprise Manager

Ø  M server control fully agent

 

Ø  利用動態批次作業相依性設定

Ø  執行結果分析

Ø  主動警示機

Ø  建立自動化流程機


Ø   

 

Ø  照批次作業執行結果的return codesystem output...等條件設計多組批次作業的後續處理動作,減少錯誤處理的時

Ø  設計介面獨立於流程監控介面之外,不會因變更流程設計而影響到當日批次作業流程的執行。

 

整合介面

用單位的需求或業界的標準,提供了與外部程式frameworkERP應用系統的整合能力,如SAPOracle E-Business SuiteETL軟體、DatabaseFTPFTPSSFTP...等。

# AD integration

 

Batch Impact Manager (BIM) 找出重要的批次流程

  • 利用Critical path (Batch Impact ManagerBIM) 功能,幫助批次作業管理人員找出批次流程中花費最多時間的執行路徑,事先發出潛在問題的告警,作為批次流程調整的依據
  • 圖說花費最多時間的執行路徑,事先發出潛在問題的告警,作為批次流程調整的依

 

Self Service網頁監控介面

使用Control-M Self Service,使用者不需要安裝Control-M Client工具,可利用瀏覽器透過網際網路,跳脫距離的限制,即時地監控當日運作的批次作業以及執行相關處理動作。


Gitea

 

https://docs.gitea.io/zh-tw/comparison/

 

Gitea vs GitLab: What are the differences?

 

Gitea: A painless self-hosted Git service. Gitea is a community managed lightweight code hosting solution written in Go. It published under the MIT license; GitLab: Open source self-hosted Git management software. GitLab offers git repository management, code reviews, issue tracking, activity feeds and wikis. Enterprises install GitLab on-premise and connect it with LDAP and Active Directory servers for secure authentication and authorization. A single GitLab server can handle more than 25,000 users but it is also possible to create a high availability setup with multiple active servers.

 

Gitea and GitLab belong to "Code Collaboration & Version Control" category of the tech stack.

 

"Self-hosted" is the primary reason why developers consider Gitea over the competitors, whereas "Self hosted" was stated as the key factor in picking GitLab.

 

Gitea and GitLab are both open source tools. It seems that GitLab with 20.1K GitHub stars and 5.33K forks on GitHub has more adoption than Gitea with 14.7K GitHub stars and 1.6K GitHub forks.

 

According to the StackShare community, GitLab has a broader approval, being mentioned in 1233 company stacks & 1475 developers stacks; compared to Gitea, which is listed in 8 company stacks and 10 developer stacks.

 

https://plugins.jenkins.io/gitea/

Mybatis

 

Mybatis

https://medium.com/%E5%B7%A5%E7%A8%8B%E7%8D%85%E6%97%A5%E5%B8%B8/hibernate-v-s-mybatis-45907ee3e6a6

MyBatis主要是SQL-Mapping的方式維護SQL Statement,查詢結果 (resultMap) 主要是用 key-value 的方式取得資料,因此若 MyBatis 要做到像 Hibernate 一樣的方法就需要多去定義不同的resultMap

 

資料查詢的方法

不同於 Hibernate 有多種查詢方式(HQLCriteriaNative SQL),MyBatis基本上都是以 Native SQL 為主

 

因為 Hibernate 已經將大多數資料庫的操作進行封裝,比較無法對 SQL Statement 優化;相反的MyBatis可以對 sql statement 進行優化。

 

MyBatis 比較被定位為 SQL Mapping 因此需要使用xml去維護需要使用的 SQL Statement,看似浪費時間,不過上手的難易度比較低

 

https://mybatis.org/mybatis-3/getting-started.html


 

Hibernate

 

Hibernate是一種Java語言下的物件關係對映ORM)解決方案。它是使用GNU寬通用公共許可證發行的自由開源的軟體。它為物件導向領域模型到傳統的關係型資料庫的對映,提供了一個使用方便的持久化框架

 

Spring Hibernate integration

 

Hibernate validation

 

# A framework for persisting / saving Java objects in a database

Ø  Handles all of low-level SQL

Ø  Minimizes the amount of JDBC code you have to develop

Ø  Provide object to relational mapping (java class and db table)

 

Ø  session.save, session.get, session.createQuery(“from Student”)

 

# Hibernate and JDBC (use jdbc for all database communication)

 

# Dev Process

Ø  d

 

# Entity Class

Ø  Java class that is mapped to a database table

Ø  Need to tell hibernate how to map this class to actual table and also how to map fields to the actual columns

 

Annotation

# @Entity

# @Table(name=student)

# @Id

# @Column(name=id)

 

#SessionFactory

#Session

 

Default Hibernate Configuration File (hibernate.cfg.xml)

Factory.getCurrentSession

Ø  Use session object to save / retrieve Java objects

Session.beginTransaction()

Session.save(tempStudent)

Session.getTransaction().commit();

Factory.close

 

HQL (Hibernate Query Language)

Session.createQuery

 

@ OneToOne

@ JoinColumn(name=instructor_detail_id)

Private InstructorDetail instructorDetail;

 

CascadeType

Ø  Default no operations are cascaded

Ø  PERSIST

Ø  REMOVE

Ø  REFRESH

Ø  Detached

Ø  MERGE

Ø  ALL

 

@OneToOne(cascade=CascadeType.ALL)

 

@OneToMany( fetch=FetchType.LAZY, cascade=CascadeType.ALL)

LAZY vs Eager

 

Uni-Directional vs Bi-Directional

 

@ManyToOne

@JoinColumn(name=instructor_id)

 

@OneToMany(mappedBy=instructor)

 

@ManyToMany

@JoinTable (

        Name = “course_student”

        joinColumns = @JoinColumn(name=course_id)

        inverseJoinColumns=@JoinColumn(name=student_id);


 

Spring MVC

 

# Model, View, Controller

# Frontend controller (DispatcherServlet), Model,

# Controller (business logic, handle request, store/ retrieve data, place data in model),

# Model, View Template (JSP + JSP standard tag library)

 

# configure web.xml

Ø  Configure spring MVC dispatcher servlet

n   contextConfigLocation

Ø  Setup URL mapping to Spring MVC Dispatcher Servlet

 

# configure contextConfigLocation

Ø  Add support for Spring component scanning

Ø  Add support for conversion, formatting and validation

Ø  Configure Spring MVC View Resolver

 

# Develop Process

Ø  Create Controller class

Ø  Define Controller method

Ø  Add Request Mapping to Controller method

Ø  Return view name

Ø  Develop view page

Ø   

 

 

Annotation

@RequestParam (Bind it to the variable)

@RequestMapping

Ø  RequestMapping to controller ( serves as parent mapping for controller)

 

Spring MVC Form Tag

Ø  Building block for a web page

Ø  Make use of data binding

Ø  Automatically setting / retrieving data from java object

Ø  Define taglib (tag library)

 

Get request < controller receive (create model ) for return model to jsp

# this model is bind a object

 

@ModelAttribute(“student”)

 

@Valid ( perform validation rules on this customer object)

 

@InitBinder = pre-process all web request coming into our controller

Ø  StringTrimmerEditor = remove whitespace – leading and trailing

 

# Custom Validation

@ Create custom java annotation from scratch

Ø  @CourseCode

Ø  1. Create custom validation rule

Ø  >Create @CourseCode annotation

n   @Constraint(validatedBy = CourseCodeConstraintValidator.class)

n   @Target

n   @Retention

n   @interface CourseCode

Ø  >CreateCourseCodeConstraintValidator


 

2022年7月18日 星期一

Spring MicroServices

 Microservice resilience with Spring Cloud

The distributed nature of microservices brings challenges. Spring helps you mitigate these. With several ready-to-run cloud patterns, Spring Cloud can help with service discovery, load-balancing, circuit-breaking, distributed tracing, and monitoring. It can even act as an API gateway.

https://spring.io/microservices



Event - Driven System 

Spring Cloud Stream 

https://tanzu.vmware.com/content/blog/getting-started-with-spring-cloud-stream


=====

https://micrometer.io/

Spring Boot’s optional instrumentation framework, Micrometer, sends metrics straight to Prometheus, Atlas, and more to provide valuable insights.




2022年7月17日 星期日

DSI Resignation

 

18 July 2022

 

Dear Jonathan,

 

Please accept this letter as notice of my formal resignation from the position of System Analyst, effective today, July 18, 2022.

 

I apologize if this causes any inconvenience. If I can be of any help to you during this transition, please let me know.

 

Wish you all the best and lots of success for DSI. 

 

Yours Sincerely,

 

 

 

 

Jerry Chong

2022年7月9日 星期六

[Course]OpenAPIs

# Swagger Hub

=> The platform for AI Design and Documentation with openAPI

https://swagger.io/tools/swaggerhub/


Open API - Specification

https://github.com/OAI/OpenAPI-Specification


Example 3.0

https://github.com/OAI/OpenAPI-Specification/tree/main/examples/v3.0


Implementations 

https://github.com/OAI/OpenAPI-Specification/blob/main/IMPLEMENTATIONS.md

# prefer visual studio


Widdershins

Redoc (personal) ***

===


Schemas

https://github.com/OAI/OpenAPI-Specification/tree/main/schemas


===

Open API 3.1.0 Spec

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md


============

Info object

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#info-object


======

Path object 

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#pathsObject


=====

JSON Schema

#OpenAPI is effectively extending out JSON schema

# regexi s a very powerful tool that you can utilize as far as doing string validations

=====

Schema Composition

https://json-schema.org/understanding-json-schema/reference/combining.html

# allOf

# anyOf

# oneOf

=============


OpenAPI data types

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#data-types


=====

OpenAPI Components

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#componentsObject


=====

Reference Object

Allow referencing other component in the specification

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#referenceObject

"$ref": " #/components/schemas/Pet"

# = within this document

# it is going to look for a map propery called Pets and that pets is expected to be either a schema Object or a reference object 


Reference the same object internally 

# great way to make sure that your OpenAPI schema is gonna be consistent because you do have this component objects that allows you to reuse those.


#  Relative Schema Document Example

> fully qualified URL

    >> {"$ref": "http://example.com/example.json/foo/bar" }


#  Relative Documents with Embedded Schema Example




IT Knowledge Map

https://docs.google.com/spreadsheets/d/1ZmN7G1unUAEpTPp5ObDnlAUtILLwwvluy-KHumMPEUU/edit#gid=0