2015年6月23日 星期二

Create sample project(1) - Spring MVC + JBoss

Actually, this pototype is stole from somewhere...
Anyway, I think this a good way to start my work.
So, let start...

Later, maybe I will research why JBoss is a good AP Server Choice, and compare with other ap server(or http server). But, this is a huge work. I desire to build something first. Otherwise, the reasons why I prefer Spring MVC be my MVC framework. Maybe it is not the best choice, but on least it work perfect on Spring framework. Maybe I will also research MVC framework later.

Prepare

There are some stuffs, we need to download before starting development.
Eclipse Luna
JBoss EAP 6.4
Maven 3.3.3

Extra Config and Plugin

If we don't find the Maven Central,  we will need to setup the Maven repository url.
Preference->Maven->Archetypes->Add Remote Catalog...
Catalog File = http://repo.maven.apache.org/maven2/archetype-catalog.xml
Description = Maven Central

And, we can install the JBoss plugin on Eclipse(many feathers which we can use).

Import Maven Project

We can quickly import the sample project from the remote Maven repository.
This is one is our need.

Setup Server and Run

Use startup or Server Perspective


See the Result



Conclusion

I cut out a lot of details, just show the key point for my note. JBoss has its own default H2 database, so we can see some database applications. Next step, we will create our own database and JPA(implemented by Hibernate) config.

Github link

https://github.com/bpmabpma/JBossExmple




2015年6月18日 星期四

Build my own project - Blueprint

Strugling a long time, I have choose some frameworks and tools to build my own project. The majority reasons I choice are free and based on Java.

AP server - JBoss, the reason which I choice is it can easily be a distributed system. There are more advantages, but I am still learning. It is new for me.  It also have support JEE standard. Its main target is EJB support, but it also support web operation now. Otherwise, it can handle other JEE standard(I am still figuring it out now)

MVC - Spring MVC, there are the plenty of options on MVC framework to choice, such as Struct 2, Wicket, Tapestry, Play, etc.  So, why I take this one.

Front End - AngularJs or React, they are two frameworks which are very popular now. They can easy develop the code of front end. I am not farmiliar with them. But, I trust them can more efficiently develop on the front end.

ORM - Hibernate, because it is very suitable with JBoss. Mybatis is another option, but it is suitable for the old database scheme or more efficient requirement.

DB - Postgre and Mongo DB, one is RMDB, one is no-sql for the different purposes. Postgre is more like Oracle, so I chose. Mongo is more popular, so... . It has its own advantage, such as easy to use, flexible, etc. But, I have really do research on other options.

IDE - Eclipse

Project Management - Maven and Ant(if it is more convenient).

Monitor - Not know yet.

Testing Tool - Maybe TestNG or just Junit, not decide yet.

CI - Jenkins

SCM - git and github...

Hey, just a list, let start building.





2015年6月12日 星期五

The todo list of second half of 2015

I have a long time to write the my blog.
I want to change this blog target.
This blog still records my research of IT technology.
But, I will write the content by English.

I have found the new job on my career.
But, I still think the goal of my career.
Oversea, remote, contractual, and consultant are all acceptable.
Architect, free System Design, Startup are all the paths of future.
Anyway, I will take some time to think about it.
The new goal in my new company also must be thought.

The goal of my career is not an emergency issue.
Even it is changeable, but I still need to find it ASAP.
Then, I will work on it.

In the short term, I will take my time to study the architect.
Then, I will create a project on the AWS.
Practice is an easy way to implement dream.

I have some skills and tools on Backend(Java).
I not very good on the front end, but still have a certain knowledge and experience.
So, I will work on some old skill, like Java, and old tool, like Eclipse.
But, I will study the new tools which I am not familiar with.

Following are the list of my study list.
Maven - This is a project manage tool.
JBoss - This is a middleware application server. Its main target is manage EJB. It is                         work on my new job.
Angular or React - There are two modern JS framework. I will choice one( or both) to               implement the front end.
MCV - Choice a Java MVC framework? I still not sure to use java be my backend
              language. There are  some frameworks, such as Spring MVC, Jersey(Restful).
MEAN - This is new architecture for web site design. Mongo, Express, Augular,
              Node.js.
 Memcached or Redis - There are two memory cach tool.
AP Server - Tomcat, JBoss, Webphere, Nginix
DB - Mongo DB
MQ - Ative MQ
Spring 4 & Java 8 - Java new tech.
Design Pattern
Refactoring
SA - Diagram

I have some skills and tools, bellowing
Eclipse, ant, Java7, JQury(not very good), html, javascript(not good), Tomcat, Wicket, Camel, linux(basic)...

Somehow I think I do not have so much time to learn or review all stuff...
Anyway, create a easy sample project first...







2015年1月10日 星期六

[Maven]基本概念

2014一下子就過去了
轉眼間就2015了…
也一陣子沒有寫Blog了
一直想整理一下常用的framework和開發工具
不過大部分的時間都在混水摸魚
希望2015能完成這個目標丫

2015的首po
就從一個很基礎的開發工具開始
Maven


2014年11月4日 星期二

IntellijIDEA學習整理-快捷鍵

前言
最近研究了一套新的IDE Intellij IDEA
主要是根據研究的資料來整理而已,並沒有針對整個對應表進行整理
這一篇先整理一下,他一些好用的快捷鍵
先主要分成幾個部分好了
第一個部分是工具視窗的部分
第二個部分是程式瀏覽和查詢的部分
第三個部分是純文字編輯的部分
第四個部分是自動化的部分
第五個部分寫一些特殊的設計的概念
另外,還有些不知道在幹嘛的,先記著

2014年8月12日 星期二

Shell Scripts和程式執行方式

好久沒寫Blogger,因為ipad太好玩了,打混了一陣子
不過這次主要要寫在linux上遇到的問題
就是執行shell script的方式,主要是要執行一段script來export一些路徑
但是卻一直沒有成功,原來是因為執行方式錯誤造成。

shell script的執行方式主要有三種
./your_script.sh
sh your_script.sh
source your_script.sh

使用./和sh的方式都會呼叫子程序的方式來執行
而source是在當前的程序執行
所以使用source來執行script就可以解決我的問題了。

如果是希望在登入的時候,就將路徑設定好
就需要到家目錄($HOME)的 .profile 或 .bashrc 設定檔加上
要export的路徑

另一個問題是在執行程式時遇到的
寫了一隻常駐程式,在compile完之後
可以使用
./your_app
的方式來執行

但我執行完後,想要把連線關閉(我在這裏使用ssh進行連線)
其常駐程式也會跟著關閉

最直接的方式是使用at的指令(at為一次執行,cron是周期執行)
新增工作排程的方式
不過他有限定特定使用者才能使用
所以用另一個指令nohup的方式來執行會更好
執行方式
nohup your_app &

參考資料:
http://linux.vbird.org/linux_basic/0340bashshell-scripts.php
http://linux.vbird.org/linux_basic/0430cron.php#whatiscron_type
http://linux.vbird.org/linux_basic/0440processcontrol.php

2014年6月25日 星期三

GDB基本操作指令

前言

之前工作debug都是使用IDE的除錯功能,就是設中斷點,然後執行,再一直點下一步,然後觀查參數的變化和在那裏發生錯誤,當然如果對開發專案的程式和架構愈熟悉的話,大概看一下Log就知道問題在那裏了。

不過最近必須開發伺服器上的C++的程式,而我都是在本機上用Notepad++寫完之後,上傳到伺服器上,用make指令進行編譯,基本上是沒辦法本機使用IDE來進行除錯的。

這樣就不用debug了嗎?當然不…,一個簡單的方法就是加log,不過只在修改程式碼不多,或是錯誤在特殊狀況出現在使用,要不然可能會被搞到瘋掉吧,一個因難的方法就是,在server上搞出一個IDE的畫面出來,理論上應該灌上桌面程式再加上遠端程式,然後放上支援Linux的IDE(如Eclipse和CodeBlock),不過不用這個方法的理由蠻多的,需要花時間研究這些東西,然後搞了半天也不一定可行,重點是把server搞掛了,可能要去喝西北風了吧…

不過,還是有一條路線可以走,那就是使用gdb(用小寫因為指令就是小寫XD),這讓我想到了MUD的遊戲,感覺真的很古早味…,在習慣了隨時可以看到code來除錯後,真的需要一點時間來習慣,需要習慣使用最強的IDE來把自已的code顯示出來,就是your brain,中文翻成你的豬腦或是魚腦,好了廢話不多說了,下面簡單的記錄一些常用的指令。