java代碼生成器用途

主要功能: 你只要設計好資料庫 就可以生成java vo
java DAO jsp
servlet
struts-config配置信息
oracle 建表語句 查詢語句 等
可生成java struts 架構的完整的源碼 包括 增加 刪除 修改 查詢等功能的源碼


1.不同的架構,需要不同的生成器
2.生成器一般需要模板技術,如freeMarker、velocity等
3.生成器也是Java項目,可以自己修改、設計、開發
4.生成器能節省一定的工作量

學這個? 網上都有現成的軟體,會用就行,使用很簡單。 如果是想學開發一個代碼生成器的話,我覺得沒必要啊。
你把JAVA 語言學會了,真正在開發的時候自然會遇見這個軟體,自然就會了

㈡ 誰有可以用的java代碼生成器啊

之前在遠標我們一般用freemarker模板引擎生做的。這東西不難,沒什麼最好的。

㈢ java代碼生成器

今年暑假准備寫個,要不要一起討論下啊

㈣ java代碼生成器怎麼用

zip包,然後自動下載下來

1.預先定義好模板

最後放出源代碼:

package com.et.controller.system.createcode;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.et.controller.base.BaseController;
import com.et.util.DelAllFile;
import com.et.util.FileDownload;
import com.et.util.FileZip;
import com.et.util.Freemarker;
import com.et.util.PageData;
import com.et.util.PathUtil;

/**
* 類名稱:FreemarkerController
* 創建人:Harries
* 創建時間:2015年1月12日
* @version
*/
@Controller
@RequestMapping(value=」/createCode」)
public class CreateCodeController extends BaseController {

/**
* 生成代碼
*/
@RequestMapping(value=」/proCode」)
public void proCode(HttpServletResponse response) throws Exception{
PageData pd = new PageData();
pd = this.getPageData();

/* ============================================================================================= */
String packageName = pd.getString(「packageName」); //包名 ========1
String objectName = pd.getString(「objectName」); //類名 ========2
String tabletop = pd.getString(「tabletop」); //表前綴 ========3
tabletop = null == tabletop?」」:tabletop.toUpperCase(); //表前綴轉大寫
String zindext = pd.getString(「zindex」); //屬性總數
int zindex = 0;
if(null != zindext && !」」.equals(zindext)){
zindex = Integer.parseInt(zindext);
}
List<String[]> fieldList = new ArrayList<String[]>(); //屬性集合 ========4
for(int i=0; i< zindex; i++){
fieldList.add(pd.getString(「field」+i).split(「,fh,」)); //屬性放到集合裡面
}

Map<String,Object> root = new HashMap<String,Object>(); //創建數據模型
root.put(「fieldList」, fieldList);
root.put(「packageName」, packageName); //包名
root.put(「objectName」, objectName); //類名
root.put(「objectNameLower」, objectName.toLowerCase()); //類名(全小寫)
root.put(「objectNameUpper」, objectName.toUpperCase()); //類名(全大寫)
root.put(「tabletop」, tabletop); //表前綴
root.put(「nowDate」, new Date()); //當前日期

DelAllFile.delFolder(PathUtil.getClasspath()+」admin/ftl」); //生成代碼前,先清空之前生成的代碼
/* ============================================================================================= */

String filePath = 「admin/ftl/code/」; //存放路徑
String ftlPath = 「createCode」; //ftl路徑

/*生成controller*/
Freemarker.printFile(「controllerTemplate.ftl」, root, 「controller/」+packageName+」/」+objectName.toLowerCase()+」/」+objectName+」Controller.java」, filePath, ftlPath);

/*生成service*/
Freemarker.printFile(「serviceTemplate.ftl」, root, 「service/」+packageName+」/」+objectName.toLowerCase()+」/」+objectName+」Service.java」, filePath, ftlPath);

/*生成mybatis xml*/
Freemarker.printFile(「mapperMysqlTemplate.ftl」, root, 「mybatis_mysql/」+packageName+」/」+objectName+」Mapper.xml」, filePath, ftlPath);
Freemarker.printFile(「mapperOracleTemplate.ftl」, root, 「mybatis_oracle/」+packageName+」/」+objectName+」Mapper.xml」, filePath, ftlPath);

/*生成SQL腳本*/
Freemarker.printFile(「mysql_SQL_Template.ftl」, root, 「mysql資料庫腳本/」+tabletop+objectName.toUpperCase()+」.sql」, filePath, ftlPath);
Freemarker.printFile(「oracle_SQL_Template.ftl」, root, 「oracle資料庫腳本/」+tabletop+objectName.toUpperCase()+」.sql」, filePath, ftlPath);

/*生成jsp頁面*/
Freemarker.printFile(「jsp_list_Template.ftl」, root, 「jsp/」+packageName+」/」+objectName.toLowerCase()+」/」+objectName.toLowerCase()+」_list.jsp」, filePath, ftlPath);
Freemarker.printFile(「jsp_edit_Template.ftl」, root, 「jsp/」+packageName+」/」+objectName.toLowerCase()+」/」+objectName.toLowerCase()+」_edit.jsp」, filePath, ftlPath);

/*生成說明文檔*/
Freemarker.printFile(「docTemplate.ftl」, root, 「說明.doc」, filePath, ftlPath);

//this.print(「oracle_SQL_Template.ftl」, root); 控制台列印

/*生成的全部代碼壓縮成zip文件*/
FileZip.zip(PathUtil.getClasspath()+」admin/ftl/code」, PathUtil.getClasspath()+」admin/ftl/code.zip」);

/*下載代碼*/
FileDownload.fileDownload(response, PathUtil.getClasspath()+」admin/ftl/code.zip」, 「code.zip」);

}

}

㈤ 用JAVA做一個JPEG圖像生成器

運行下試試!·

import java.awt.*;
import java.util.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import com.sun.image.codec.jpeg.*;
class Point
{int x,y;
Point(int x,int y)
{this.x=x;this.y=y;
}
}
public class MakeJPEG extends Canvas implements MouseMotionListener,MouseListener,ActionListener
{
int x=-1,y=-1,橡皮擦通知=0,清除通知=0;
Vector v=null;int n=1;
Graphics2D ggg ;
BufferedImage image;
Frame window;
Button 保存,調色板,橡皮,清除,畫筆,獲取屏幕,繪制圖形;
Color 畫筆顏色;
Panel pCenter,pSouth,pNorth;

public MakeJPEG()
{
保存=new Button("將繪制的圖形或屏幕保存為JPG文件");
獲取屏幕=new Button("獲取屏幕");
繪制圖形=new Button("繪制圖形");
調色板=new Button("打開調色板");
畫筆=new Button("畫筆");
橡皮=new Button("橡皮");
清除=new Button("清除");
調色板.addActionListener(this);
繪制圖形.addActionListener(this);
保存.addActionListener(this);
畫筆.addActionListener(this);
橡皮.addActionListener(this);
清除.addActionListener(this);
獲取屏幕.addActionListener(this);
畫筆顏色=new Color(0,0,0);
addMouseMotionListener(this);
addMouseListener(this);
v=new Vector();
setBackground(Color.white);
image=new BufferedImage(200,200,BufferedImage.TYPE_INT_RGB);
ggg=image.createGraphics();
Rectangle2D rect=new Rectangle2D.Double(0,0,200,200);
ggg.setColor(getBackground());
ggg.fill(rect);
window=new Frame("JPEG圖像生成器");
pCenter=new Panel();
pCenter.setLayout(null);
pCenter.add(this);
pCenter.setBackground(Color.gray);
this.setBounds(80,30,210,210);
window.add(pCenter,BorderLayout.CENTER);
pNorth=new Panel();
pNorth.add(保存);
pNorth.add(繪制圖形);
pNorth.add(獲取屏幕);
window.add(pNorth,BorderLayout.NORTH);
pSouth=new Panel();
pSouth.add(調色板);
pSouth.add(橡皮);
pSouth.add(清除);
pSouth.add(畫筆);
window.add(pSouth,BorderLayout.SOUTH);
window.setVisible(true);
window.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
window.setBounds(100,80,390,380);
window.validate();
}
public void paint(Graphics g)
{
if(x!=-1&&y!=-1&&橡皮擦通知==0&&清除通知==0)
{
g.setColor(畫筆顏色);
n=v.size();
for(int i=0;i<n-1;i++)
{
Point p1=(Point)v.elementAt(i);
Point p2=(Point)v.elementAt(i+1);
g.drawLine(p1.x,p1.y,p2.x,p2.y);
ggg.setColor(g.getColor());
ggg.drawLine(p1.x,p1.y,p2.x,p2.y);
}
}
else if(橡皮擦通知==1&&清除通知==0)
{
g.setColor(getBackground());
g.fillRect(x-2,y-2,4,4);
ggg.setColor(getBackground());
ggg.fillRect(x-2,y-2,4,4);
}
else if(清除通知==1&&橡皮擦通知==0)
{
g.setColor(getBackground());
g.fillRect(0,0,200,200);
ggg.setColor(getBackground());
ggg.fillRect(0,0,200,200);
}

g.drawImage(image,0,0,200,200,this);
}
public void mouseDragged(MouseEvent e)
{
x=(int)e.getX();
y=(int)e.getY();
Point p=new Point(x,y);
v.addElement(p);
repaint();
}
public void mouseMoved(MouseEvent e)
{}
public void mousePressed(MouseEvent e)
{}
public void mouseReleased(MouseEvent e)
{
v.removeAllElements();
}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
public void mouseClicked(MouseEvent e){}

public void update(Graphics g)
{
{
paint(g);
}
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==橡皮)
{
橡皮擦通知=1;
清除通知=0 ;
}
else if(e.getSource()==清除)
{
清除通知=1;
橡皮擦通知=0;
repaint();
}
else if(e.getSource()==畫筆)
{
橡皮擦通知=0;
清除通知=0;
}

else if(e.getSource()==保存)
{
FileDialog savedialog=new FileDialog(window,"保存圖型到JPG格式",FileDialog.SAVE);

savedialog.setVisible(true);

if(savedialog.getFile()!=null)
{
try{
String fileName=savedialog.getFile();
FileOutputStream out=new FileOutputStream(fileName);

JPEGImageEncoder encoder=JPEGCodec.createJPEGEncoder(out);

JPEGEncodeParam param=encoder.getDefaultJPEGEncodeParam(image);

param.setQuality(1.0f,false);
encoder.setJPEGEncodeParam(param);

encoder.encode(image);
out.close();
}
catch(Exception EE)
{
}
}
}
else if(e.getSource()==獲取屏幕)
{
Robot robot=null;
try{
robot=new Robot();
}
catch(Exception er)
{
}
Rectangle screenRect=null;
int width=getToolkit().getScreenSize().width;
int height=getToolkit().getScreenSize().height;
screenRect=new Rectangle(0,0,width,height);

window.setVisible(false);
this.window.setVisible(false);
image=robot.createScreenCapture(screenRect);
window.setVisible(true);
repaint();
}
else if(e.getSource()==調色板)
{
Color tempColor=JColorChooser.showDialog(window,"調色板",畫筆顏色);
{
if(tempColor!=null)
{
畫筆顏色=tempColor;
畫筆.setForeground(畫筆顏色);
}
}
}
else if(e.getSource()==繪制圖形)
{
window.dispose();
this.window.dispose();
MakeJPEG canvas=new MakeJPEG();
}
}
public static void main(String args[])
{
new MakeJPEG();
}
}

㈥ 求簡單易用的java代碼生成器,可以三層架構模式生成代碼或其他模式生成(如:簡單工廠)和一些簡單方法。

你別告訴我,你要的是可以幫你寫代碼的軟體?
這個軟體不可能有的,就算可以做程序員也不會做,砸自己飯碗么

㈦ 求助大神,要求用java代碼寫一個序列生成器

importjava.util.HashMap;
importjava.security.KeyException;
importjava.sql.Connection;
importjava.sql.PreparedStatement;
importjava.sql.ResultSet;
importjava.sql.SQLException;

/**
*類<code>Key</code>是一個資料庫主鍵生成器,用序列號的方式來產生資料庫中需要的主鍵值。
*<p>
*<code>Key</code>目前支持的資料庫包括Oracle的所有版本、MySql的3.x以上的版本
*以及所有支持max()函數的資料庫,支持欄位類型僅為數字類型的主鍵,對於字元及其它類型的主鍵尚不提供支持。
*<p>
*在使用時只需提供表名、欄位名(主鍵)以及到資料庫的JDBC連接,如果想要獲得message表的id欄位的下一個主鍵值時:
*<p>
*<blockquote>
*
*<pre>
*java.sql.Connectionconn=...;
*org.shaoye.common.sql.Keykey=org.shaoye.common.sql.Key.getInstance();
*intkeyValue=key.getNextKey("message","id",conn);
*Stringsql="insertintomessage(id,...)values("+keyValue+",...)";
*//執行插入操作...
*</pre>
*
*</blockquote>
*<p>
*
*@author令少爺([email protected])
*@sincemagic0.1
*/
publicfinalclassKey{

/**
*key的最大值,默認為9223372036854775807,即long類型的最大值
*/
privatelongmax=9223372036854775807L;

/**
*key的最小值,默認為1
**/
privatelongmin=1L;

/**
*Key的唯一實例,通過getInstance()方法獲得
**/
privatestaticKeykeygen=newKey();

/**
*KeyInfo類的實例列表,默認容量為5個
**/
privateHashMap<String,KeyInfo>keyList=newHashMap<String,KeyInfo>(5);//keyInfo
//列表

/**
*私有的默認構造方法,防止外部構造類的實例
**/
privateKey(){
}

/**
*獲得Key的唯一實例
**/
publicstaticKeygetInstance(){
returnkeygen;
}

/**
*用指定的表和欄位獲得key的下一個值,主鍵的值不得超過2147483647
*
*@paramtableName
*資料庫中的表名,表中必須有一個數字主鍵
*@paramkeyName
*表(tableName)中的欄位名
*@paramconn
*JDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的下一個主鍵的int值
*@throws<code>KeyException</code>
*如果表名或欄位名不存在、訪問資料庫錯誤或key的值大於2147483647時拋出
*/
publicintgetNextKey(StringtableName,StringkeyName,Connectionconn)
throwsKeyException{
longvalue=getNextKeyLong(tableName,keyName,conn);
if(value>2147483647L){
thrownewKeyException(
"Key'svaluetoobig,!");
}
return(newLong(value)).intValue();
}

/**
*用指定的表和欄位獲得key的下一個值,最大為9223372036854775807
*@paramtableName資料庫中的表名,表中必須有一個數字主鍵
*@paramkeyName表(tableName)中的欄位名
*@paramconnJDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的下一個主鍵的long值
*@throws<code>KeyException</code>如果表名或欄位名不存在或訪問資料庫錯誤時拋出
*/
publiclonggetNextKeyLong(StringtableName,StringkeyName,Connectionconn)
throwsKeyException{
KeyInfokeyinfo;
Stringitem=tableName+"."+keyName;
try{
if(keyList.containsKey(item)){
keyinfo=(KeyInfo)keyList.get(item);
}else{
keyinfo=newKeyInfo(tableName,keyName,conn);
keyList.put(item,keyinfo);
}
returnkeyinfo.getNextKey();
}catch(SQLExceptionsqle){
thrownewKeyException(sqle);
}
}

/**
*用指定的"表<code>.</code>欄位"形式的字元串獲得key的下一個值,主鍵的值不得超過2147483647
*@paramtableDotField"表.欄位"形式的字元串,如:message.id
*@paramconnJDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的下一個主鍵的int值
*@throws<code>KeyException</code>如果表名或欄位名不存在、訪問資料庫錯誤或key的值大於2147483647時拋出
*/
publicintgetNextKey(StringtableDotField,Connectionconn)
throwsKeyException{
longvalue=getNextKeyLong(tableDotField,conn);
if(value>2147483647L){
thrownewKeyException(
"Key'svaluetoobig,!");
}
return(newLong(value)).intValue();
}

/**
*用指定的"表<code>.</code>欄位"形式的字元串獲得key的下一個值,最大為9223372036854775807
*@paramtableDotField"表.欄位"形式的字元串,如:message.id
*@paramconnJDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的下一個主鍵的int值
*@throws<code>KeyException</code>如果表名或欄位名不存在或訪問資料庫錯誤時拋出
*/
publiclonggetNextKeyLong(StringtableDotField,Connectionconn)
throwsKeyException{
intdot_index=tableDotField.indexOf(".");
if(tableDotField.indexOf(".")<1){
thrownewKeyException("UnknownKey'"+tableDotField+"'!");
}
Stringtab=tableDotField.substring(0,dot_index);
Stringkey=tableDotField.substring(dot_index);
returngetNextKeyLong(tab,key,conn);
}

/**
*用指定的表和欄位獲得key的當前值,主鍵的值不得超過2147483647
*@paramtableName資料庫中的表名,表中必須有一個數字主鍵
*@paramkeyName表(tableName)中的欄位名
*@paramconnJDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的當前int值
*@throws<code>KeyException</code>
*如果表名或欄位名不存在、訪問資料庫錯誤或key的值大於2147483647時拋出
*/
publicintgetCurrentKey(StringtableName,StringkeyName,Connectionconn)
throwsKeyException{
longvalue=getCurrentKeyLong(tableName,keyName,conn);
if(value>2147483647L){
thrownewKeyException(
"Key'svaluetoobig,!");
}
return(newLong(value)).intValue();
}

/**
*用指定的表和欄位獲得key的當前值,最大為9223372036854775807
*
*@paramtableName
*資料庫中的表名,表中必須有一個數字主鍵
*@paramkeyName
*表(tableName)中的欄位名
*@paramconn
*JDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的當前long值
*@throws<code>KeyException</code>如果表名或欄位名不存在或訪問資料庫錯誤時拋出
*/
publiclonggetCurrentKeyLong(StringtableName,StringkeyName,
Connectionconn)throwsKeyException{
KeyInfokeyinfo;
Stringitem=tableName+"."+keyName;
try{
synchronized(keyList){
if(keyList.containsKey(item)){
keyinfo=(KeyInfo)keyList.get(item);
}else{
keyinfo=newKeyInfo(tableName,keyName,conn);
keyList.put(item,keyinfo);
}
}
returnkeyinfo.getCurrentKey();
}catch(SQLExceptionsqle){
thrownewKeyException(sqle);
}
}

/**
*用指定的"表<code>.</code>欄位"形式的字元串獲得key的當前值,主鍵的值不得超過2147483647
*
*@paramtableDotField
*"表.欄位"形式的字元串,如:message.id
*@paramconn
*JDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的當前int值
*@throws<code>KeyException</code>如果表名或欄位名不存在、訪問資料庫錯誤或key的值
*大於2147483647時拋出
*/
publicintgetCurrentKey(StringtableDotField,Connectionconn)
throwsKeyException{
longvalue=getCurrentKeyLong(tableDotField,conn);
if(value>2147483647L){
thrownewKeyException(
"Key'svaluetoobig,!");
}
return(newLong(value)).intValue();
}

/**
*用指定的"表<code>.</code>欄位"形式的字元串獲得key的當前值,最大為9223372036854775807
*
*@paramtableDotField
*"表.欄位"形式的字元串,如:message.id
*@paramconn
*JDBC連接,如果欲獲得的key是第一次取值,則必須保證conn能連接到資料庫
*@returnkey的當前int值
*@throws<code>KeyException</code>如果表名或欄位名不存在或訪問資料庫錯誤時拋出
*/
publiclonggetCurrentKeyLong(StringtableDotField,Connectionconn)
throwsKeyException{
intdot_index=tableDotField.indexOf(".");
if(tableDotField.indexOf(".")<1){
thrownewKeyException("UnknownKey'"+tableDotField+"'!");
}
Stringtab=tableDotField.substring(0,dot_index);
Stringkey=tableDotField.substring(dot_index);
returngetCurrentKeyLong(tab,key,conn);
}
}

/**
*內部類,用來存儲主鍵信息
**/
classKeyInfo{
privatelongmax=9223372036854775807L;
privatelongmin=1L;
privatelongnextKey;
privateStringtableName;
privateStringkeyName;
privateConnectionconn=null;

/**
*keyInfo對象初始化
*
*@throwsKeyException
*/
KeyInfo(StringtableName,StringkeyName,Connection_conn)
throwsSQLException,KeyException{
this.tableName=tableName;
this.keyName=keyName;
this.conn=_conn;
retrieveFromDB();
}

intgetMax(){
return(newLong(max)).intValue();
}

longgetMaxLong(){
returnmax;
}

intgetMin(){
return(newLong(min)).intValue();
}

longgetMinLong(){
returnmin;
}

/**
*取下一鍵值
*/
intgetNextKey(){
return(newLong(getNextKeyLong())).intValue();
}

/**
*取下一鍵值
*/
(){
nextKey++;
returnnextKey;
}

/**
*取當前鍵值
*/
synchronizedintgetCurrentKey(){
return(newLong(nextKey)).intValue();
}

/**
*取當前鍵值
*/
(){
returnnextKey;
}

/**
*從資料庫中取當前最大值
*
*@throwsKeyException
*/
voidretrieveFromDB()throwsSQLException,KeyException{
PreparedStatementpstmt=null;
ResultSetrs=null;
Stringsql="selectmax("+keyName+")from"+tableName;
try{
pstmt=conn.prepareStatement(sql);
}catch(Exceptionex){
thrownewKeyException("Can'tconnectDataBase!");
}
try{
rs=pstmt.executeQuery();
}catch(SQLExceptionsqle){
if(pstmt!=null)
pstmt.close();
thrownewKeyException("'"+keyName+"'or'"+tableName
+"'isn'texistinDataBase!",sqle);
}
try{
if(rs.next()){
nextKey=rs.getLong(1);
if(nextKey<min){
nextKey=min;
}
}else{
nextKey=min;
}
}catch(SQLExceptionsqle){
throw(sqle);
}finally{
if(rs!=null)
rs.close();
if(pstmt!=null)
pstmt.close();
}
}
}

㈧ JAVA自動創建實體類工具

AutoJava 是一款免費來的,針對於Oracle和自SQLserver資料庫的、以面向對象模式的Java代碼生成工具。AutoJava根據O/R Mapping規則生成表對應的Java對象,並且生成了所有的添加、刪除、修改、查詢等底層資料庫操作代碼。藉助於AutoJava我們基本上不用再寫與資料庫相關的操作代碼,只需要在此基礎上實現相關的業務邏輯,將我們從重復的無太大技術含量的工作中解放出來。
AutoJava 是我在工作中為了省時間而寫出來的一個小工具,希望AutoJava能給廣大的Java人員在編碼過程中節省時間。這是地址 http://www.skycn.com/soft/27950.html

㈨ 跪求圖片生成器java全代碼,要求可以畫圖和獲取屏幕並且能保存。拜託各位大神了

正好寫了一個,給你看看哈

1234567891011121314151617
import java.awt.*;import java.awt.image.BufferedImage;import java.io.File;import java.util.Date; import javax.imageio.ImageIO;public class ScreenCapturer { public static void main(String[] args) throws Exception{ Date date = new Date(); Robot rbt = new Robot(); BufferedImage bf = rbt.createScreenCapture(new Rectangle(1440,900)); //這是屏幕解析度 可以根據自己的屏幕修改 File file = new File("d://"+ date.toString().replace(" ","").replace(":","")+".jpg"); //這是保存路徑D盤根目錄 ImageIO.write(bf,"jpg",file); System.out.println("截圖成功!保存於D盤根目錄下!時間:" + date.toString()); } }

㈩ java代碼生成器是什麼

代碼生成器就是根據特定的要求制定格式,靈活輸出在項目中重復要用到的代碼,節省項目時間,現在免費的代碼生成器codesmith我經常用的,小玩意,不花錢