Id,OwnerUserId,CreationDate,Tags,AnswerCount,CommentCount,FavoriteCount,ViewCount,Score,Title,Body "44915","15464","2011-02-07 10:56:19","","2","0","2","374","3","Is a Model Driven Architecture in Language Oriented Programming (MPS) feasible at this time","

As a side project I am developing some sort of DSL where I describe a data model, and generate desired code files from it. I believe this is called Model Driven Architecture. My partial existing implementation uses C#, CodeDOM, XML and XSLT to do this manually.

I discovered there already exist better environments to do this in. The one which fascinated me the most is called MPS, which follows the Language Oriented Programming paradigm. This article, written by a cofounder of JetBrains was a real eye opener for me. I truly believe LOP has a very good chance of becoming the next big programming paradigm once it has broader support. From my short experience with MPS, I noticed it is still mainly Java-oriented.

My question is, how feasible is it to generate code files for other (multiple) languages instead of just Java. I don't need full language support from the start, so preferably, I need to be able to implement a language in a agile way. E.g. first support only one type, add access modifiers, ...

Perhaps some other (free) environment already provides this out of the box.

P.S.: I find it important to have a lot of control over the naming conventions and such of the generated code. This is one of the reasons why I started my own implementation.

UPDATE:

Judging from the answers it seems like people think I'm only interested in .NET solutions. This is not the case, any other suggestions are highly welcomed!

" "55679","10422","2011-03-07 19:32:24","","17","4","9","14744","21","Why aren't we all doing model driven development yet?","

I am a true believer in Model Driven Development, I think it has the possibility to increase productivity, quality and predictability. When looking at MetaEdit the results are amazing. Mendix in the Netherlands is growing very very fast and has great results.

I also know there are a lot of problems

  • versioning of generators, templates and framework
  • projects that just aren't right for model driven development (not enough repetition)
  • higher risks (when the first project fails, you have less results than you would have with more traditional development)
  • etc

But still these problems seem solvable and the benefits should outweigh the effort needed.

Question: What do you see as the biggest problems that make you not even consider model driven development ?

I want to use these answers not just for my own understanding but also as a possible source for a series of internal articles I plan to write.

" "82496","21523","2011-06-08 14:38:17","<.net>","4","0","","223","5","Is defining every method/state per object in a series of UML diagrams representative of MDA in general?","

I am currently working on a project where we use a framework that combines code generation and ORM together with UML to develop software. Methods are added to UML classes and are generated into partial classes where ""stuff happens"". For example, an UML class ""Content"" could have the method DeleteFromFileSystem(void). Which could be implemented like this:

public partial class Content
{
    public void DeleteFromFileSystem()
    {
        File.Delete(...);
    }
}

All methods are designed like this. Everything happens in these gargantuan logic-bomb domain classes.

Is this how MDA or DDD or similar usually is done? For now my impression of MDA/DDD (which this has been called by higherups) is that it severely stunts my productivity (everything must be done The Way) and that it hinders maintenance work since all logic are roped, entrenched, interspersed into the mentioned gargantuan bombs.

Please refrain from interpreting this as a rant - I am merely curious if this is typical MDA or some sort of extreme MDA

UPDATE

Concerning the example above, in my opinion Content shouldn't handle deleting itself as such. What if we change from local storage to Amazon S3, in that case we would have to reimplement this functionality scattered over multiple places instead of one single interface which we can provide a second implementation for.

" "120529","2286","2011-11-18 18:59:48","","2","2","1","1410","7","What's the real benefit of meta-modeling?","

After reading several texts about meta-modeling I still do not really get the practical benefit. Sometimes I think it is only an interesting mind game but no useful tool. Sure it is wise to clarify your modeling vocabulary: some may say class where others say entity or concept, but this is just simple documentation your modeling terminology. Meta-modeling, as I understand it, is more complex, as it tries to formalize and abstract modeling. Some good examples are Keet's formal comparison of conceptual data modeling languages (UML, ERM and ORM) from academia and the Meta Object Facility (MOF) from industry. To me MOF looks as impractical as CORBA, which was also created by OMG. In theory you could use meta-modeling to transform and integrate models in different modeling languages, but is anyone actually doing this?

" "151804","966","2012-06-06 17:56:24","","2","6","","928","0","Open source projects and MDD?","

Model-driven development seems to have a lot of buzz in certain software engineering circles, but I've never encountered an open source MDD projects ""in the wild"".

Are any open source projects using model-driven development? (I don't just mean that there's some UML documentation, but that the primary artifacts that the developers manipulate are the models, rather than the code).

" "153656","32342","2012-06-20 19:58:54","","4","1","4","3365","17","""UML is the worst thing to ever happen to MDD."" Why?","

William Cook in a tweet wrote that:

""UML is the worst thing to ever happen to MDD. Fortunately many people now realize this ...""

I would like to know the reasoning behind that claim (apparently, I'm not referring to his personal opinion).

I've noticed that many people out there don't like UML that much. Also it is worth mentioning that he is in academia, where UML is preety much the holy grail of effective design and modelling.

" "196940","65701","2013-05-03 11:52:41","","1","0","","207","0","Extending Composite Structure model generally/in Enterprise Architect","

I'm currently on a project, which integrates domain specific techniques in the modelling tool Enterprise Architect through UML Profiles.

The domain specfic model almost matches the structure of the composite structure model, with a couple of restrictions though, so I'm trying to use the model as a foundation for my restrictions.

The questions:

1) How can I generally extend models (like composite structure models) which themselves lie in the M1-layer of Meta-Object Facility?

2) Is the element ""Part"" of composite structure diagrams a metaclass itself, which can be extended by stereotypes in UML profiles?

Since the literature on these topics is not very exhaustive, I'm also looking for suggestions, too.

" "199244","65701","2013-05-24 08:25:30","","3","0","0","970","3","UML modelling semantics","

In today's lecture about Modelling techniques with respect to MDD using UML the lecturer stated that it's absolutely necessary to give a (possibly) textual description about the semantics of each diagram you produce.

In my opinion it's not necessary to describe semantics of diagram elements which are already standardized by UML. I can see that it's completely appropriate if you extend the standard UML by stereotypes/tagged values for any reason.

In contrast, I think that standardization has in the ordinary case the intention to let people reason and talk about diagrams without the need to explain semantics every time. The only precondition is of course that they all rely on the same UML specification.

Another point regarding MDD is that using different semantics from time to time for the same diagram kind makes code generation and automatic model transformation difficult in the end.

  1. Am I right with this notion?
  2. Are there some inherent interpretation ambiguities in UML to make it more general usable?
" "312909","147933","2016-03-16 12:14:34","","3","0","","734","5","How to report multiple errors as a result of validation?","

I have a class that transforms a complex model, for example an abstract syntax tree or intermediate model. The model can be either valid, invalid or partially invalid, i.e. it contains errors but some parts of it are valid and can be processed further.

The most simple error reporting is to use exceptions:

public class Transformer {
    public TargetModel transform(SourceModel model)
      throws InvalidModelException {
        // ...
    }
}

Obviously this doesn't allow to report multiple errors (at least if you don't attach further information to the exception) and exceptions should be for exceptional situations.

Martin Fowler addressed this problem in his article Replacing Throwing Exceptions with Notification in Validations. If you apply his method to the problem you have something like this:

public abstract class Problem {
    // ...
}

public final class ProblemA {
    // ...
}

public final class ProblemB {
    // ...
}

public class Transformer {
    public static final class TransformationResult {
        private Collection<Problem> problems;
        private Optional<TargetModel> targetModel;
        // ...
    }

    public TransformationResult transform(SourceModel model) {
        // ...
    }
}

You then either use the visitor pattern or instanceof checks to distinguish the errors. It's a trade-off between type-safety and verbosity.

Another possible solution would be to use the observer pattern:

public class Transformer {
    public interface ProblemListener {
        public void onProblemA(...);
        public void onProblemB(...);
        // ...
    }

    public void addProblemListener(ProblemListener listener) {
        // ...
    }

    public void removeProblemListener(ProblemListener listener) {
        // ...
    }

    public TargetModel transform(SourceModel model) {
        // ...
    }
}

Using the observer pattern has the advantage that you don't have to accumulate the errors in memory and that excessive instanceof checks or visitors are not needed. On the other hand it obscures the control flow even more than the visitor pattern.

I think all solutions do not lead to readable code. In a functional language and with enough memory I would use the second solution but in Java structural pattern matching either entails instanceof checks or use of visitor pattern which are both verbose. Is there anything that I have overlooked? Or implications that I did not consider? What is your experience with any of the solutions?

"