Are there visual/graphical MDD tools for Ruby on Rails? - ruby-on-rails

This is going to be pretty vague, so I hope I done get banned for it.
I've been learning about various dynamic web tools such as ruby on rails that can require a huge number of referencing between files (master view controllers, assets etc). Typically, when designing a rails application, I now draw the whole thing out in inkscape so that I have a visual representation of how all the files are connected to one another.
It would be really useful if I could translate the simple workflow diagram into some skeletal code. For example dragging a red block onto the page would create a controller, dragging an arrow in a direction towards a named view would then create the def in the controller etc etc. It's just an idea, but I wondered as a result if there were any graphical tools I could manipulate in order to do this kind of task?
If such a tool doesn't exist I'm happy to try and code one up myself - any ideas for a starting point?

A quick web search for model-driven rails came up with a master thesis (pdf) comparing graphical model driven development (in a J2EE context) with Rails' textual model driven development approach. So one could assume that the usual way to develop a Ruby-on-Rails application is already considered model-driven, just that the used domain specific language is a textual (and ruby-based) one instead of a graphical one, and that this textual approach is deemed sufficient. This would make it unlikely for graphical modeling tools for Rails to exist.
But another search result is the ModelDriven Rails Plugin which claims to be just such a tool. It doesn't use SVG images but UML diagrams.
If you decide to actually come up with your own code generator, consider accepting UML input as well. UML is the standard for visual software modeling and much better suited than SVGs: SVGs are more about the look of the diagram than its semantics.
One problem with UML is though, that I don't know of a single, universally accepted file format for exchanging UML. Almost each UML editor/modeling software seems to come with a file format of its own.

Related

What's the purpose and mechanism of Ontology in D3WEB

In the expert system D3WEB, it is possible to insert\develop\use Ontology. However, I cannot get the point what's the purpose to introduce ontology in D3WEB?
The nice example on this page, https://www.d3web.de/Wiki.jsp?page=Demo%20-%20Ontology , shows how to develop an ontology in D3WEB. In my opinion, it can be more efficiently developed using Protégé. If the contents shall be changed with a real application, for instance, an ontology about 'dog', in the real application there could be instance dog A, B, C, D. It might be not feasible to 'insert' the instances into the D3WEB knowledge base. However, if the ontology changes over time, how to use the ontology in D3WEB then?
In my opinion, the best way is to develop an ontology outside of D3WEB using Java code. However, I believe the designer of D3WEB would have a nice reason to introduce ontology in D3WEB. I will appreciate it if someone let me know.
This is a somewhat common question we get regarding d3web-KnowWE, one reason might be, that our naming is somewhat misleading. So let me explain.
First there is d3web the java framework to run knowledge bases with strong problem solving knowledge, including rules, decision trees, flow-charts, covering lists, cost-benefit dialog strategies, time based reasoning, and so on. This framework in its core does not provide any GUIs, but is meant to integrate problem solving capabilities in other applications/expert systems. It also does not provide a way to properly create/author the knowledge bases it runs, aside maybe from doing it in the Java code on an API level.
To also provide proper means to author and develop a knowledge base, including some basic dialogs to run, demo, test, and debug the authored knowledge bases, we began working on the wiki system KnowWE, which today is basically a heavily extended JSPWiki. The page d3web.de itself for example is also just a build of KnowWE with specific content.
While we were working on and with KnowWE, we began to really like the approach to edit and author large knowledge bases in this 'wiki way', were you automatically support multiple distributed users to work on the same knowledge base, have automatic versioning, can add nice documentation directly beside the actual formal knowledge, can generate knowledge using script (because it's all just simple text markup), and so forth. Also, the underlying architecture of KnowWE became quite good and mature over the years.
So after some time of this, we found ourselves in the need to also author large ontologies. And yes, Protégé is a nice tool to develop ontologies, but for our use cases, it was just not well suited and we also found it to not scale very well. So we began to implement some simple markups to also allow to also develop ontologies in KnowWE. After then recognizing, that authoring ontologies the 'wiki way' indeed works pretty nicely, we decided to again also share these tools with everybody else on d3web.de. And that is why today you can author/develop both d3web knowledge bases and ontologies in KnowWE, although there is no actual connection/interoperability between both as of now. That would be nice of course and maybe we add this in the future, but for KnowWE is just a development environment for these two knowledge representation.
Maybe you can see KnowWE similar to an IDE like eclipse or IntelliJ, where the same application can be used to develop many different programming languages. KnowWE does the same for different knowledge representations.
A problem is maybe, that historically, we didn't differentiate very well between KnowWE and d3web, because KnowWE was narrowly used to build d3web knowledge bases. We also like to call KnowWE and its distribution package d3web-KnowWE for example. But maybe this should change...
Thanks for pointing this out, I will try to correct/clarify this on d3web.de

Maintaining large numbers of Concordion scripts

I am currently working for a large organisation with about 2k developers working in our IT department. We maintain many things including our e-commerce platform and there are currently about 30 projects currently impacting that.
Recently all of our teams have been instructed to deliver a series of automated tests using Concordion and Selenium Webdriver. For a while this has been going fairly well and many tests have been created but lately maintaining the existing tests while our e-commerce platform constantly changes has been somewhat of a nightmare. We have thousands of test scripts covering many parts of our website but there does not seem to be any facility in Concordion to split scripts into reusable compartments which could then be maintained once, rather than having to make changes to hundreds of HTML files for one change.
How are other people approaching this?
The goal of Concordion is not to implement test scripts as HTML, but rather for the HTML to describe the behaviour that you are testing (what you are trying to achieve). The implementation details (how it is being tested) are implemented as Java code. This code can then be structured with an appropriate level of abstraction so that each change to the system under test only requires a change to one part of the code.
Your HTML specifications should only need to change on the rare occasions that the business rules change.
These concepts are described further on the Hints and Tips tab of the Concordion home page.
Thank you for sharing your experience with us. It’s great to hear / read about large scale application of behavior driven development / specification by example.
One approach that could help you is to focus on key examples (http://gojko.net/2014/05/05/focus-on-key-examples). During specification workshops the entire team is working to get a common understanding of the new user needs and requirements. Then you go on and write specification documents containing key examples. There you should not try to cover everything, but to write only as many examples as necessary to express the common understanding.
Additionally, you should try to identify concepts, on which the examples are based. Are there some examples related to a similar topic – this is probably an underlying concept. It is often easier to understand the examples, if they focus just on one concept (e.g. the validation of a card number). Each concept can be usually described with only a few examples.
Do you have any other types of automated tests (e.g. unit tests)? Are you experiencing the same maintainability challenges with these other tests? Could you use good practices from these other test types to improve your Concordion approach?
Could you tell us more about your setup? How many active specifications have you already created within your company?

what is ruby on rails?

I am a front end developer (HTML,CSS,JS & jQuery) I know a bit of PHP. I am trying to grasp what Ruby/Ruby on Rails is.
On http://rubyonrails.org/ it says "Ruby on Rails is an open-source web framework that's optimized for programmer happiness"
In actual, non-dreamy terms, what is special about Ruby/Ruby on Rails, and how can a person like myself benefit from learning to use it?
My simple question is: whose sister is it? PHP, mySQL, ASP, coldFusion, jsp, apache?
What does it do?
The Language
Ruby is a recent programming language that shares most of its heritage with Perl and Smalltalk. You can see what Ruby looks like (and try it yourself) at tryruby.org.
Just like you can use PHP to write web pages, you can do the same thing with Ruby.
The Framework
Ruby on Rails is a set of software devices that help you to more easily write a website in Ruby. The primary things they try to facilitate ("make easy") are:
Storing related data (e.g. blog posts and the comments on them) to a database.
Accepting web requests and respond to them programmatically (e.g. check a user's password)
Composing HTML using your data, with layouts and templates to make it easier.
"Rails," as it's called for short, is built with extreme prejudice towards certain application models, particularly MVC. What this means is that unlike PHP, where any .php source file is fair game for any bit of code, most code in a Rails application is written in a particular, conventional place. When people compare Rails to PHP, they often point this out.
There's a lot I didn't cover, but these are Rails' most basic features. To see what it looks like, I'd suggest watching the infamous, "Creating a Weblog..." screencast.
If you're looking for something to compare it to for someone coming from PHP, think of it like CakePHP for ruby. It's a bunch of pre-developed low-level classes and systems that can then be extended out to use in many different systems. It also bundles in a lot of other helpful tools and a plugin architecture. It uses ruby and an HTML templating language based on ruby (erb) rather than PHP.
It's a framework for Ruby whose sweet spot is CRUD based web apps. They make a number of assumptions (aka "conventions") that make it easy and fast to create tables with 1:1, 1:m, and m:n relationships, objects, controllers, and web pages for exposing and manipulating that data on the web.
Ruby is just another object-oriented language, like Java, C++, or C#. It was invented by a gentleman from Japan.
This might not be the best analogy, but like you would use HTML/CSS/JS to display a cohesive entity with specific stuff in their specific places. Rails provides a framework to allow you to work in an organized environment with specific stuff in their specific places. As well as having goodies to provide for more rapid development.
Generally:
Html would contain the content you want to display, while CSS would help control the specific look of that content, while JS would allow you to manipulate or interacte with said content.
Rails, uses MVC (Model, View, Controller) to provide a similar organization. Where Data objects are generally categorized as Models, while Views control the displaying of the Data. And Controllers would would facilitate the flow of that data from View to Model and vice versa.
Rails is not the only game in town. So do look around, as there are other great frameworks out there, and find the one best suited to your style and language needs.
Philosophy and design
Ruby on Rails is intended to emphasize Convention over Configuration (CoC), and the rapid development principle of Don't Repeat Yourself (DRY).
"Convention over Configuration" means a developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products sold", that the developer needs to write code regarding these names. Generally, this leads to less code and less repetition.
"Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using the ActiveRecord module of Rails, the developer does not need to specify database column names in class definitions. Instead, Ruby on Rails can retrieve this information from the database based on the class name.
Taken from wikipedia
Ruby An elegant object-oriented programming language with objects like Smalltalk and syntax something like Python and Perl. It's kind of what PHP would have been had it been done right. That is, Ruby takes features from advanced "real" languages and combines them with the interpreted efficient syntax and library-rich practicality of Perl, Python, and PHP.
RailsAn advanced web framework. Many recent web frameworks are considered to be copies of or at least inspired by Rails. (Google "rails clone".) "The first good web framework".
Both Ruby and Rails are generally highly regarded.
Ruby is an object oriented programming language. Rails is a framework built in Ruby for developing web applications. I have been using rails for about 6 months now, and its been great so far. If you want some of the same features of rails, you should also consider django (python), cakephp or symfony (php).
Pros:
MVC Architecture - Code is organized,
broken up into small, manageable
files
Database abstraction - you dont have
to write SQL queries, database types
are easily interchanged
Convention over Configuration - rails automatically knows file, database, variable names without explicitly being specified
Fast Development - Rails requires less lines of code because of all the functions it automatically takes care of and is more expressive, resulting in faster development
Cons:
Slower - this is often debated, but a comparable rails application is slower than its PHP counterpart. Rails 3 is supposedly going to include speed increases.
Less Literature - rails lacks the plethora of tutorials, books and api that is available for PHP.
Less Hosting Support - Not all shared hosts support rails, but you can set it up on any vps or dedicated. Deployment is also a bit tougher in Rails as opposed to PHP
Ruby is a programming language. Ruby on Rails is a piece of software written in Ruby, it helps you develop web applications.
You can look at Ruby on Rails as if it is a set of tools. It helps you do common tasks when you're making a dynamic web application. E.g. session handling, cookies, database interaction, etc.
Rails goes beyond being just a library, though. To really understand this, you would have to experiment with it, which is actually very easy.
Rails Guides is a fantastic place to start.

Best Practice in Delphi Rapid Application Development in term of Reusability [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How to improve our productivity when starting new project using Delphi?
For me, I create a template project including splash screen, primary data module with default component and all data-aware subroutines (open, close, query, default when failed to open DB, etc), and save the template in my repository. (I use all my own frames and unit in the project, so everything always be created automatically when I choose : New Project and choosing my template.)
Questions:
Is there any other way to improve reusability using Delphi?
What free open source framework (like Jedi) / IDE PLugins (like GExpert) you think is best to use using Delphi?
Pardon me if this question has been asked before.
For Q1: Use mature libraries which do for you the grunt work: DevExpress -or- TMS for UI (JEDI's JVCL also is very good), FastReport for reporting. Choose also a good connectivity framework (it depends on your db back-end) in order to have many day-to-day tasks solved OOTB. Also, if you're familiar with OPF have a look at InstantObjects. I heard that's very nice.
For Q2: See the IDE enchancements from cnpack.org
Also it will help to slowly build your own specialized framework/set of tools. Not something very big but as a quick way to get some things done in your way. Always try to design for reuse, even if it takes a little bit longer in the beginning.
For larger applications, the key to productivity is to work at a higher abstraction level than data module and database.
The database has a small set of types. In your domain you are likely to have default mappings from domain types to database types. You'll also have validators and formatters for them.
You'll have default reports, filters and search (windows, panels, sql queries) for your domain entities. You'll have role-based access control to them.
Take a look at domain-driven development.
One of my big gains in reusability in recent years has been moving to an ORM layer (I use tiopf) to separate out my business objects from the database.
As an example, I have db persisted, background threaded email objects. To add them to another application, I add in the required units and add a few lines of configuration (table/field mapping). Similarly I have user objects, generic lookup lists and the like all of which can be added to different projects for the price of initial configuration. This works on different databases without any changes other than configuration.
tiopf is my ORM of choice (read my overview here) but there are numerous others.
Defining the exact range of applications you want to make is a good first step. Improving productivity is nearly always related to specialization. General tools is just an extremely small percentile of productivity. I'd rather search (or make) specialized frameworks in my line of work if I really wanted to boost productivity.
I don't use GExperts, or another plugin. I don't benefit greatly (being able to grep just fine on the cmdline) in productivity, and any crash that can be avoided due to problems in the plugin is then a pre.
I used ModelMaker with Delphi. It is really nice tool that lets you draw objects and then can generate code based on templates you write.
It can speed up things when there is number of similar classes in project.
For Q2: GExperts is useful. The grep search comes in particularly handy, although the search / replace can cause odd side affects (inserting characters it shouldn't!).
I know you mentioned free / open source, but Castalia is very good. The refactoring methods work well and I like the structural highlighting, which makes it much easier to work with code (I did originally use CodeRush for this but it went Visual Studio only). The Bookmark stack is also handy for quick going back and forth through code.
Also, if you are a team, look for ways to improve your development process. Besides using Delphi as your implementation language, what are your project management methods? What source code management system do you use? What is your build system? Do you use automated testing methods? etc.
When I introduced Scrum at a previous employer, we got an almost immediate 50% improvement in team productivity. So check out the various Agile methodologies.
For true reusability, try to think in interfaces and try to black box as much as possible. Patterns are everywhere, research them and put them into practice.
When dealing with objects, as much as possible use the abstract, or an interface rather than a concrete implementation. Just be careful of taking this too far. Too many abastractions can add complexity and make debugging harder.
Units containing your business rules should be used by your gui. Units containing business rules should never themselves directly use gui units.
When I ask questions like this about "what is the best thing to do or to use" they are quickly removed from the site by the moderators.
In my opinion, you are right to use the sample template. Also #John Thomas is correct. But you can go beyond:
Use a template for database procedures and functions to work with requests;
Try to put the most of the database logic inside the database using stored procedures and functions. This way you don't have to worry about selecting what is common use and what is specific to current project;
Use a template for main menu and main screen;
Instead of crating many windows, create one TFrame for each module of your application and reserve a place in the main screen to load them. Create an object of this frame in memory only when the user clicks it's menu. This way, your system gets faster and more memory economic;
Reuse those frames by creating base frames with the common functionality and layout and them create new frames descendants from it.
Just great!

Metamodelling tools

What tools are available for metamodelling?
Especially for developing diagram editors, at the moment trying out Eclipse GMF
Wondering what other options are out there?
Any comparison available?
Your question is simply too broad for a single answer - due to many aspects.
First, meta-modelling is not a set term, but rather a very fuzzy thing, including modelling models of models and reaching out to terms like MDA.
Second, there are numerous options to developing diagram editors - going the Eclipse way is surely a nice option.
To get you at least started in the Eclipse department:
have a look at MOF, that is architecture for "meta-modelling" from the OMG (the guys, that maintain UML)
from there approach EMOF, a sub set which is supported by the Eclipse Modelling Framework in the incarnation of Ecore.
building something on top of GMF might be indeed a good idea, because that's the way existing diagram editors for the Eclipse platform take (e.g. Omondo's EclipseUML)
there are a lot of tools existing in the Eclipse environment, that can utilize Ecore - I simply hope, that GMF builts on top of Ecore itself.
Dia has an API for this - I was able to fairly trivially frig their UML editor into a basic ER modelling tool by changing the arrow styles. With a DB reversengineering tool I found in sourceforge (took the schema and spat out dia files) you could use this to document databases. While what I did was fairly trivial, the API was quite straightforward and it didn't take me that long to work out how to make the change.
If you're of a mind to try out Smalltalk There used to be a Smalltalk meta-case framework called DOME which does this sort of thing. If you download VisualWorks, DOME is one of the contributed packages.
GMF is a nice example. At the core of this sits EMF/Ecore, like computerkram sais. Ecore is also used for the base of Eclipse's UML2 . The prestige use case and proof of concept for GMF is certainly UML2 Tools.
Although generally a UML tool, I would look at StarUML. It supports additional modules beyond what are already built in. If it doesn't have what you need built in or as a module, I supposed you could make your own, but I don't know how difficult that is.
Meta-modeling is mostly done in Smalltalk.
You might want to take a look at MOOSE (http://moose.unibe.ch). There are a lot of tools being developed for program understanding. Most are Smalltalk based. There is also some java and c++ work.
Two of the most impressive tools are CodeCity and Mondrian. CodeCity can visualize code development over time, Mondrian provides scriptable visualization technology.
And of course there is the classic HotDraw, which is also available in java.
For web development there is also Magritte, providing meta-descriptions for Seaside.
I would strongly recommend you look into DSM (Domain Specific Modeling) as a general topic, meta-modeling is directly related. There are eclipse based tools like GMF that currently require java coding, but integrate nicely with other eclipse tools and UML. However there are two other classes out there.
MetaCase which I will call a pure DSM tool as it focuses on allowing a developer/modeler with out nearly as much coding create a usable graphical model. Additionally it can be easily deployed for others to use. GMF and Microsoft's Beta software factory/DSM tool fall into this category.
Pure Meta-modeling tools which are not intended for DSM tooling, code generation, and the like. I do not follow these tools as closely as I am interested in applications that generate tooling for SMEs, Domain Experts, and others to use and contribute value to an active project not modeling for models sake, or just documentation and theory.
If you want to learn more about number 1, the tooling applications for DSMs/Meta-modeling, then check out my post "DSMForum.org great resources, worth a look." or just navigate directly to the DSMForum.org
In case you are interested in something that is related to modelling and not generation of code, have a look at adoxx.org. As a metamodelling platform it does provide functionalities and mechanisms to quickly develop your own DSL and allows you to focus on the models needs (business requirements, conceptual level design/specification). There is an active community from academia and practice involved developing prototypical as well as commercial application based on the platform. Could be interesting ...

Resources