1. SOME Introduction

Have you heard of SOME?

SOME(Simple Object Model Edit) is not a programming language, it just seems like to be. If you know UML very well, you will understand SOME quite easily. Compared to UML, SOME seems more like a lauguage because it contains only "words" and "sentences", unlike UML.
 
SOME vs. UML
But just like UML, SOME helps you design applications in an object-oriented way. It really can be seen as a simple UML without diagrams, In 1.0 version,you will see two  UML features in SOME, class model and sequence model. On the other hand, as a "language", SOME has a complete suite of grammar specification. Here are some examples for describing the relations between SOME and UML:
 
class diagram in UML:
 
type declaration in SOME:
AStrategy                                                 //Abstract class Strategy{}
         a_DoAlgorithm()                                   //public abstract void DoAlgorithm()
 
CFirstStrategy : AStrategy                    //class FirstStrategy: Strategy{}
         o_DoAlgorithm()                                   //public override void DoAlgorithm()
 
CSecondStrategy : AStrategy               //class SecondStrategy: Strategy{}
         o_DoAlgorithm()                                   //public override void DoAlgorithm()
 
CContext ->AStrategy[_s]          //reference list
         (Strategy _s)                                 //constructor
         DoWork()
         DoStrategyWork()
 
CCliet
         main                                                        //abbreviation of main entry
 
sequence diagram in UML:
sequence definition in SOME:
   
CClient.main
{
         CFirstStrategy firstStrategy.();              //FirstStrategy firstStrategy = new FirstStrategy();
         CContext c.(_s = firstStrategy);           //Constructor with quick assignment
         c.DoWork();                                                                        //only invoking
         c.DoStrategyWork()                                                 //invoking and definition
         {                                                       //definition beginning of Context::DoStrategyWork()
                   _s.DoAlgorithm<CFirstStrategy>()             //override method invoking and definition
                   {                                                                //definition beginning of CFirstStrategy::DoAlgorithm()
                            <% Console.WriteLine("In first strategy"); %>             //object code snippet
                   };                                                               //end of definition: CFirstStrategy::DoAlgorithm()
         };                                                      //end of definition: Context::DoStrategyWork()
}
 
code in c#:
         abstract class Strategy
         {
                   abstract public void DoAlgorithm();
         }
 
         class FirstStrategy : Strategy
         {
                   override public void DoAlgorithm()
                   {
                            Console.WriteLine("In first strategy");                          
                   }
         }
 
         class SecondStrategy : Strategy
         {
                   override public void DoAlgorithm()
                   {
                            Console.WriteLine("In second strategy");                   
                   }
         }
 
         class Context
         {
                   Strategy s;
                   public Context(Strategy strat)
                   {
                            s = strat;                     
                   }
 
                   public void DoWork()
                   {
                            // some of the context's own code goes here
                   }
 
                   public void DoStrategyWork()
                   {
                            // now we can hand off to the strategy to do some
                            // more work
                            s.DoAlgorithm();
                   }
         }
 
    ///<summary>
    ///    Summary description for Client.
    ///</summary>
    public class Client
    {
        public static int Main(string[] args)
                   {       
                            FirstStrategy firstStrategy = new FirstStrategy();
                            Context c = new Context(firstStrategy);
                            c.DoWork();
                            c.DoStrategyWork();
 
            return 0;
        }
    }
  
As you can see, a type declaration is just like class diagram, while a sequence definition is a plain-text way for sequence diagram. A SOME model emphasizes not only the static structure for class relations, but the dynamic flow of how objects cooperate and in what order they execute. Furthermore, you can place multiple type declarations and sequence definitions in any order, and SOME generator does know how to organize them in an object-oriented way and translate them into real coding languages you desired to have.
 
Just simple
SOME is a light-weight language, a type of object-oriented pseudocode, learning and using SOME is quite simple and time-saving, you just need a text edit tool, and all you have to do next is to input your codes and save them into a SOME "source file". After that SOME compiler will check its grammar, at next step SOME generator will make it into source codes in a certain object-oriented language(ranging from c++, java, c# to VB.net, even MSIL.) . Actually, "Compiling" is the process of Code Engineering, the useful feature which also exists in UML. Besides, having no keywords make itself look even simpler. Instead of keywords, it uses some short tokens such as ".", "->", or specific prefix to denote pre-defined meanings. see the examples below(c#):
"CSample" means "class Sample".
"o_Method()" means "public override void Method()".
"int r_Length" means "private int _length; public int Length{get{return _length};}" (note: read-only property).
"CSample s<CSubSample>.();" means "CSample s = new CSubSample();".
"obj;" means "return obj;".
 
If you're fed up with the CASE tools or Drag & Drop, you really need to consider SOME, which can give you a rather efficient way that drag & drop cannot. The general troubles of using CASE tools are always large-size model files, bad generality and strong dependency on a certain program. However, if you use mouse more than keyboard, or you're a fan of windows GUI. SOME is not prepared for you. Secondly, SOME is not used to design the whole system, but to build a skeleton for a certain business process in a very concise way. On design phase, as I know, some skilled programmers get used to direct coding instead of document-style design. For those people, SOME is absolutely a good choice.
 
Who is SomeOne?
SomeOne is a simple tool to support SOME design. It contains three parts: The Editor helps to edit and save SOME codes. The Compiler checks the grammar and the Generator generates source files even as well as some IDE project files(such as Visual Studio). In first version, four languages will be supported, they're c#, c++, java and MSIL. You need to choose any of the four as the object language before you prepare to generate. As a mere design tool, SomeOne does not care about the grammar checking and compiling for the codes it has generated.
 
Just for fun, don't be serious
SOME is a product of whiling away the hours, and I promise that if I still have plenty of time to waste, you will see SomeOne V1.0 SOMEDAY.
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值